Skip to content

Commit 97fe3e8

Browse files
committed
🚿 no need for call_user_func*
1 parent b0a61d3 commit 97fe3e8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/SettingsContainerAbstract.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
use ReflectionClass, ReflectionProperty;
1414

15-
use function call_user_func, call_user_func_array, get_object_vars, json_decode, json_encode, method_exists, property_exists;
15+
use function get_object_vars, json_decode, json_encode, method_exists, property_exists;
1616
use const JSON_THROW_ON_ERROR;
1717

1818
abstract class SettingsContainerAbstract implements SettingsContainerInterface{
@@ -40,7 +40,7 @@ protected function construct():void{
4040
$method = $trait->getShortName();
4141

4242
if(method_exists($this, $method)){
43-
call_user_func([$this, $method]);
43+
$this->{$method}();
4444
}
4545
}
4646

@@ -58,7 +58,7 @@ public function __get(string $property){
5858
$method = 'get_'.$property;
5959

6060
if(method_exists($this, $method)){
61-
return call_user_func([$this, $method]);
61+
return $this->{$method}();
6262
}
6363

6464
return $this->{$property};
@@ -76,7 +76,7 @@ public function __set(string $property, $value):void{
7676
$method = 'set_'.$property;
7777

7878
if(method_exists($this, $method)){
79-
call_user_func_array([$this, $method], [$value]);
79+
$this->{$method}($value);
8080

8181
return;
8282
}

0 commit comments

Comments
 (0)