1 | <?php |
||
11 | final class HierarchyDiscriminatorResolver |
||
12 | { |
||
13 | private function __construct() |
||
16 | |||
17 | /** |
||
18 | * This method is needed to make INSTANCEOF work correctly with inheritance: if the class at hand has inheritance, |
||
19 | * it extracts all the discriminators from the child classes and returns them |
||
20 | */ |
||
21 | 13 | public static function resolveDiscriminatorsForClass( |
|
41 | } |
||
42 |
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: