| 1 | <?php |
||
| 4 | class ApplySalesman |
||
| 5 | { |
||
| 6 | |||
| 7 | /** |
||
| 8 | * @var Callable |
||
| 9 | */ |
||
| 10 | public $salesman_factory; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var SalesmanInterface |
||
| 14 | */ |
||
| 15 | public $salesman_fallback; |
||
| 16 | |||
| 17 | |||
| 18 | /** |
||
| 19 | * @param callable $salesman_factory Callable that takes a Salesman ID that should return a SalesmanInterface instance. |
||
| 20 | */ |
||
| 21 | public function __construct( callable $salesman_factory, SalesmanInterface $salesman_fallback = null ) |
||
| 26 | |||
| 27 | |||
| 28 | /** |
||
| 29 | * @param object $aggregator Object that |
||
| 30 | * @return bool |
||
| 31 | */ |
||
| 32 | public function __invoke( $aggregator ) |
||
| 59 | } |
||
| 60 |
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: