File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,7 @@ public function build()
59
59
{
60
60
return array_filter (
61
61
$ this ->flatMap ($ this ->acceptedProperties , function ($ property ) {
62
-
63
- $ method = $ this ->getMethodForProperty ($ property );
64
-
65
- return [$ property => $ this ->$ method ()];
62
+ return [$ property => $ this ->getValueForProperty ($ property )];
66
63
})
67
64
);
68
65
}
Original file line number Diff line number Diff line change @@ -93,6 +93,15 @@ public function getMethodForProperty($method)
93
93
return $ this ->getMethodsMap ()[$ method ] ?? null ;
94
94
}
95
95
96
+ public function getValueForProperty ($ property )
97
+ {
98
+ if ($ method = $ this ->getMethodForProperty ($ property )) {
99
+ return $ this ->$ method ();
100
+ }
101
+
102
+ return null ;
103
+ }
104
+
96
105
public function call ($ method )
97
106
{
98
107
return method_exists ($ this ->object , $ method ) ? $ this ->object ->$ method () : null ;
You can’t perform that action at this time.
0 commit comments