1 | <?php |
||
18 | class Definition implements ArgumentResolverInterface, DefinitionInterface |
||
19 | { |
||
20 | use ArgumentResolverTrait; |
||
21 | use ContainerAwareTrait; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $alias; |
||
27 | |||
28 | /** |
||
29 | * @var mixed |
||
30 | */ |
||
31 | protected $concrete; |
||
32 | |||
33 | /** |
||
34 | * @var boolean |
||
35 | */ |
||
36 | protected $shared = false; |
||
37 | |||
38 | /** |
||
39 | * @var array |
||
40 | */ |
||
41 | protected $tags = []; |
||
42 | |||
43 | /** |
||
44 | * @var array |
||
45 | */ |
||
46 | protected $arguments = []; |
||
47 | |||
48 | /** |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $methods = []; |
||
52 | |||
53 | /** |
||
54 | * @var mixed |
||
55 | */ |
||
56 | protected $resolved; |
||
57 | |||
58 | /** |
||
59 | * @param string $id |
||
60 | * @param mixed|null $concrete |
||
61 | */ |
||
62 | 66 | public function __construct(string $id, $concrete = null) |
|
68 | |||
69 | 6 | public function addTag(string $tag): DefinitionInterface |
|
74 | |||
75 | 6 | public function hasTag(string $tag): bool |
|
79 | |||
80 | 36 | public function setAlias(string $id): DefinitionInterface |
|
85 | |||
86 | 33 | public function getAlias(): string |
|
90 | |||
91 | 9 | public function setShared(bool $shared = true): DefinitionInterface |
|
96 | |||
97 | 9 | public function isShared(): bool |
|
101 | |||
102 | 12 | public function getConcrete() |
|
106 | |||
107 | 3 | public function setConcrete($concrete): DefinitionInterface |
|
113 | |||
114 | 12 | public function addArgument($arg): DefinitionInterface |
|
119 | |||
120 | 3 | public function addArguments(array $args): DefinitionInterface |
|
128 | |||
129 | 3 | public function addMethodCall(string $method, array $args = []): DefinitionInterface |
|
138 | |||
139 | 3 | public function addMethodCalls(array $methods = []): DefinitionInterface |
|
147 | |||
148 | 42 | public function resolve() |
|
156 | |||
157 | 42 | public function resolveNew() |
|
197 | |||
198 | /** |
||
199 | * @param callable $concrete |
||
200 | * @return mixed |
||
201 | */ |
||
202 | 12 | protected function resolveCallable(callable $concrete) |
|
207 | |||
208 | 30 | protected function resolveClass(string $concrete): object |
|
214 | |||
215 | 36 | protected function invokeMethods(object $instance): object |
|
225 | } |
||
226 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.