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 SalesmanIdProviderInterface|StdClass $aggregator Object that provides a salesman_id |
||
30 | * @return bool |
||
31 | */ |
||
32 | public function __invoke( $aggregator ) |
||
60 | } |
||
61 |
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: