1 | <?php |
||
16 | trait ValueParserPart { |
||
17 | |||
18 | private $constMap = [ |
||
19 | 'false' => false, |
||
20 | 'true' => true |
||
21 | ]; |
||
22 | |||
23 | /** |
||
24 | * Parses the value of a node into the model |
||
25 | * |
||
26 | * @param ValueInterface $obj |
||
27 | * @param Node $node |
||
28 | * @return void |
||
29 | */ |
||
30 | 10 | private function parseValue(ValueInterface $obj, Node $node) { |
|
40 | |||
41 | /** |
||
42 | * Returns whether this node is a primitive value |
||
43 | * |
||
44 | * @param Node $node |
||
45 | * @return boolean |
||
46 | */ |
||
47 | 7 | private function isPrimitive(Node $node) { |
|
54 | |||
55 | /** |
||
56 | * Returns the primitive value |
||
57 | * |
||
58 | * @param Node $node |
||
59 | * @return mixed |
||
60 | */ |
||
61 | 7 | private function getPrimitiveValue(Node $node) { |
|
72 | |||
73 | /** |
||
74 | * Returns whether this node is a boolean value |
||
75 | * |
||
76 | * @param Node $node |
||
77 | * @return boolean |
||
78 | */ |
||
79 | 7 | private function isBool(Node $node) { |
|
89 | |||
90 | /** |
||
91 | * Returns whether this node is a null value |
||
92 | * |
||
93 | * @param Node $node |
||
94 | * @return boolean |
||
95 | */ |
||
96 | 7 | private function isNull(Node $node) { |
|
102 | |||
103 | /** |
||
104 | * Returns the value from a node |
||
105 | * |
||
106 | * @param Node $node |
||
107 | * @return mixed |
||
108 | */ |
||
109 | 6 | private function getExpression(Node $node) { |
|
132 | } |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: