DrdPlus/Theurgist/Spells/ToFlatArrayTrait.php
Showing 2 of 2 total issues
Function toFlatArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function toFlatArray(array $items): array { $flat = []; foreach ($items as $item) { if (\is_array($item)) {
- Read upRead up
The method toFlatArray uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
Open
} else { $flat[] = $item; }
- Read upRead up
- Exclude checks