1 | <?php |
||
24 | class CoreLoader implements LoaderDecoratorInterface |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * @var EE_Registry|CoffeeShop $generator |
||
29 | */ |
||
30 | private $generator; |
||
31 | |||
32 | |||
33 | |||
34 | /** |
||
35 | * CoreLoader constructor. |
||
36 | * |
||
37 | * @param EE_Registry|CoffeeShop $generator |
||
38 | * @throws InvalidArgumentException |
||
39 | */ |
||
40 | public function __construct($generator) |
||
52 | |||
53 | |||
54 | |||
55 | /** |
||
56 | * @param string $fqcn |
||
57 | * @param array $arguments |
||
58 | * @return mixed |
||
59 | * @throws EE_Error |
||
60 | * @throws ServiceNotFoundException |
||
61 | */ |
||
62 | public function load($fqcn, $arguments = array()) |
||
68 | |||
69 | |||
70 | |||
71 | /** |
||
72 | * calls reset() on generator if method exists |
||
73 | */ |
||
74 | public function reset() |
||
80 | |||
81 | } |
||
82 | // End of file CoreLoader.php |
||
84 |
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: