| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public static function conflict(MappingInterface ...$mappings): bool |
||
| 12 | { |
||
| 13 | $mappings = array_values($mappings); |
||
| 14 | for ($i = 0; $i < sizeof($mappings) - 1; $i++) { |
||
| 15 | $subject = $mappings[$i]; |
||
| 16 | for ($j = $i + 1; $j < sizeof($mappings); $j++) { |
||
|
|
|||
| 17 | if (static::conflicts($subject, $mappings[$j])) { |
||
| 18 | return true; |
||
| 19 | } |
||
| 20 | } |
||
| 21 | } |
||
| 22 | return false; |
||
| 23 | } |
||
| 43 |
If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration: