| Conditions | 4 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 90 | 6 | protected function resolveArray(): static |
|
| 91 | { |
||
| 92 | 6 | $resolvedArray = []; |
|
| 93 | |||
| 94 | 6 | foreach ($this->pages() as $page) { |
|
| 95 | 6 | if (is_string($page) && is_subclass_of($page, IndexPage::class)) { |
|
| 96 | 6 | $resolvedArray[ $page::name() ] = $page; |
|
| 97 | } |
||
| 98 | } |
||
| 99 | |||
| 100 | 6 | $this->resolvedArray = $resolvedArray; |
|
| 101 | |||
| 102 | 6 | return $this; |
|
| 103 | } |
||
| 105 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.