@@ -53,15 +53,19 @@ protected function construct():void{
53
53
54
54
/**
55
55
* @inheritdoc
56
+ *
57
+ * @return mixed|null
56
58
*/
57
59
public function __get (string $ property ){
58
60
59
61
if (!property_exists ($ this , $ property ) || $ this ->isPrivate ($ property )){
60
62
return null ;
61
63
}
62
64
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 ]);
65
69
}
66
70
67
71
return $ this ->{$ property };
@@ -76,8 +80,10 @@ public function __set(string $property, $value):void{
76
80
return ;
77
81
}
78
82
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 ]);
81
87
82
88
return ;
83
89
}
@@ -159,7 +165,7 @@ public function fromJSON(string $json):SettingsContainerInterface{
159
165
/**
160
166
* @inheritdoc
161
167
*/
162
- public function jsonSerialize (){
168
+ public function jsonSerialize (): array {
163
169
return $ this ->toArray ();
164
170
}
165
171
0 commit comments