Conditions | 5 |
Paths | 5 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 16 | public function read(?SchemaProviderInterface $nextProvider = null): ?array |
|
19 | { |
||
20 | 16 | if ($this->providers === null) { |
|
21 | 1 | throw new RuntimeException(self::class . ' is not configured.'); |
|
22 | } |
||
23 | 15 | $parts = []; |
|
24 | 15 | foreach ($this->providers as $provider) { |
|
25 | 12 | $parts[] = $provider->read(); |
|
26 | } |
||
27 | |||
28 | 13 | $schema = (new SchemaMerger())->merge(...$parts); |
|
|
|||
29 | |||
30 | 12 | if ($schema !== null || $nextProvider === null) { |
|
31 | 10 | return $schema; |
|
32 | } |
||
33 | 3 | return $nextProvider->read(); |
|
34 | } |
||
36 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.