Browse Source

Removed uses of call_user_func in MagicProperties.

main 1.0.4
Dustin Wilson 2 years ago
parent
commit
c9aa6b9659
  1. 4
      lib/MagicProperties.php

4
lib/MagicProperties.php

@ -15,7 +15,7 @@ trait MagicProperties {
if ($methodName === null) {
throw new Exception(Exception::NONEXISTENT_PROPERTY, $name);
}
return call_user_func([ $this, $methodName ]);
return $this->$methodName();
}
public function __isset(string $name): bool {
@ -25,7 +25,7 @@ trait MagicProperties {
public function __set(string $name, $value) {
$methodName = $this->getMagicPropertyMethodName($name, false);
if ($methodName !== null) {
call_user_func([ $this, $methodName ], $value);
$this->$methodName($value);
return;
}

Loading…
Cancel
Save