1 | <?php |
||
23 | class CoreLoader implements LoaderInterface |
||
24 | { |
||
25 | |||
26 | /** |
||
27 | * @var EE_Registry|CoffeeShop $generator |
||
28 | */ |
||
29 | private $generator; |
||
30 | |||
31 | |||
32 | |||
33 | /** |
||
34 | * CoreLoader constructor. |
||
35 | * |
||
36 | * @param EE_Registry|CoffeeShop $generator |
||
37 | * @throws InvalidArgumentException |
||
38 | */ |
||
39 | public function __construct($generator) |
||
51 | |||
52 | |||
53 | |||
54 | /** |
||
55 | * @param string $fqcn |
||
56 | * @param array $arguments |
||
57 | * @return mixed |
||
58 | * @throws ServiceNotFoundException |
||
59 | */ |
||
60 | public function load($fqcn, $arguments = array()) |
||
66 | |||
67 | |||
68 | |||
69 | /** |
||
70 | * calls reset() on generator if method exists |
||
71 | */ |
||
72 | public function reset() |
||
78 | |||
79 | } |
||
80 | // End of file CoreLoader.php |
||
81 | // Location: core/services/loaders/CoreLoader.php |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: