Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
44 | 2 | public function resolve(string $objectClass, string $resourceClass): ResourceAssemblerInterface |
|
45 | { |
||
46 | /** @var ResourceAssemblerSupportableInterface $supportable */ |
||
47 | 2 | foreach ($this->map as [$supportable, $assembler]) { |
|
48 | 1 | if ($supportable->supports($objectClass, $resourceClass)) { |
|
|
|||
49 | 1 | return $assembler; |
|
50 | } |
||
51 | } |
||
52 | |||
53 | 1 | throw new ResourceAssemblerNotFoundException(sprintf( |
|
54 | 1 | 'Not found assembler for resource by class "%s" and object by class "%s".', |
|
55 | 1 | $resourceClass, |
|
56 | 1 | $objectClass |
|
57 | )); |
||
58 | } |
||
59 | } |
||
60 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.