Skip to content

Commit 68bc501

Browse files
committed
🚿
1 parent 0f33644 commit 68bc501

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/SettingsContainerAbstract.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,19 @@ protected function construct():void{
5353

5454
/**
5555
* @inheritdoc
56+
*
57+
* @return mixed|null
5658
*/
5759
public function __get(string $property){
5860

5961
if(!property_exists($this, $property) || $this->isPrivate($property)){
6062
return null;
6163
}
6264

63-
if(method_exists($this, 'get_'.$property)){
64-
return call_user_func([$this, 'get_'.$property]);
65+
$method = 'get_'.$property;
66+
67+
if(method_exists($this, $method)){
68+
return call_user_func([$this, $method]);
6569
}
6670

6771
return $this->{$property};
@@ -76,8 +80,10 @@ public function __set(string $property, $value):void{
7680
return;
7781
}
7882

79-
if(method_exists($this, 'set_'.$property)){
80-
call_user_func_array([$this, 'set_'.$property], [$value]);
83+
$method = 'set_'.$property;
84+
85+
if(method_exists($this, $method)){
86+
call_user_func_array([$this, $method], [$value]);
8187

8288
return;
8389
}
@@ -159,7 +165,7 @@ public function fromJSON(string $json):SettingsContainerInterface{
159165
/**
160166
* @inheritdoc
161167
*/
162-
public function jsonSerialize(){
168+
public function jsonSerialize():array{
163169
return $this->toArray();
164170
}
165171

0 commit comments

Comments
 (0)