Skip to content

Commit f925945

Browse files
authored
Reverted back the way magic __call method types (set, get, etc...) are identified
1 parent 8d74dcd commit f925945

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/internal/Magento/Framework/DataObject.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,19 +387,21 @@ public function toString($format = '')
387387
*/
388388
public function __call($method, $args)
389389
{
390-
switch($method[0]) {
391-
case 'g':
390+
switch(\substr((string)$method, 0, 3)) {
391+
case 'get':
392392
return $this->_data[
393393
self::$_underscoreCache[$method] ?? $this->_underscore($method)
394394
] ?? null;
395-
case 's':
395+
case 'set':
396396
$this->_data[
397397
self::$_underscoreCache[$method] ?? $this->_underscore($method)
398398
] = $args[0] ?? null;
399399
return $this;
400-
case 'u':
401-
return $this->unsetData(self::$_underscoreCache[$method] ?? $this->_underscore($method));
402-
case 'h':
400+
case 'uns':
401+
return $this->unsetData(
402+
self::$_underscoreCache[$method] ?? $this->_underscore($method)
403+
);
404+
case 'has':
403405
return isset(
404406
$this->_data[
405407
self::$_underscoreCache[$method] ?? $this->_underscore($method)

0 commit comments

Comments
 (0)