1 | <?php |
||
20 | final class AppInjector implements InjectorInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var AbstractAppMeta |
||
24 | */ |
||
25 | private $appMeta; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $context; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | private $scriptDir; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | private $appDir; |
||
41 | |||
42 | /** |
||
43 | * @var ScriptInjector |
||
44 | */ |
||
45 | private $injector; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | private $cacheSpace; |
||
51 | |||
52 | /** |
||
53 | * @var AbstractModule|null |
||
54 | */ |
||
55 | private $module; |
||
56 | |||
57 | /** |
||
58 | * @param string $name application name 'MyVendor\MyProject' |
||
59 | * @param string $context application context 'prod-app' |
||
60 | * @param AbstractAppMeta|null $appMeta application meta |
||
61 | * @param string $cacheSpace cache namespace |
||
62 | * @param string $envFile .env file path '/path/to/project/.env' |
||
63 | */ |
||
64 | 37 | public function __construct(string $name, string $context, AbstractAppMeta $appMeta = null, string $cacheSpace = '', string $envFile = '') |
|
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | 18 | public function getInstance($interface, $name = Name::ANY) |
|
95 | |||
96 | 1 | public function getOverrideInstance(AbstractModule $module, $interface, $name = Name::ANY) |
|
103 | |||
104 | 35 | public function clear() |
|
112 | |||
113 | 18 | public function getCachedInstance($interface, $name = Name::ANY) |
|
128 | |||
129 | 28 | private function getModule() : AbstractModule |
|
143 | } |
||
144 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: