Accessing foo on the interface PHPUnit\Framework\MockObject\MockObject suggest that you code against a concrete implementation. How about adding an instanceof check?
If you access a property on an interface, you most likely code against a
concrete implementation of the interface.
Both the $myVar assignment in line 1 and the $higher assignment in line 2
are dead. The first because $myVar is never used and the second because
$higher is always overwritten for every possible time line.
Accessing foo on the interface PHPUnit\Framework\MockObject\MockObject suggest that you code against a concrete implementation. How about adding an instanceof check?
If you access a property on an interface, you most likely code against a
concrete implementation of the interface.
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: