Conditions | 7 |
Paths | 7 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 7.2269 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 4 | public function read(?SchemaProviderInterface $nextProvider = null): ?array |
|
19 | { |
||
20 | 4 | if ($this->providers === null) { |
|
21 | throw new RuntimeException(self::class . ' is not configured.'); |
||
22 | } |
||
23 | 4 | if ($this->providers->count() === 0) { |
|
24 | 2 | return $nextProvider === null ? null : $nextProvider->read(); |
|
25 | } |
||
26 | 3 | $parts = []; |
|
27 | 3 | foreach ($this->providers as $provider) { |
|
28 | 3 | $parts[] = $provider->read(); |
|
29 | } |
||
30 | |||
31 | 3 | $schema = (new SchemaMerger())->merge(...$parts); |
|
|
|||
32 | |||
33 | 2 | if ($schema !== null || $nextProvider === null) { |
|
34 | 2 | return $schema; |
|
35 | } |
||
36 | return $nextProvider->read(); |
||
37 | } |
||
39 |
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.