| Conditions | 4 |
| Paths | 6 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | private static function helper(array &$chessboard, int $row, int &$num): int |
||
| 18 | { |
||
| 19 | if ($row === $count = count($chessboard)) { |
||
| 20 | $num++; |
||
| 21 | } |
||
| 22 | |||
| 23 | for ($col = 0; $col < $count; $col++) { |
||
| 24 | if (self::isAttackedRange($chessboard, $row, $col)) { |
||
| 25 | $chessboard[$row] = $col; |
||
| 26 | self::helper($chessboard, $row + 1, $num); |
||
| 27 | $chessboard[$row] = 0; |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | return $num; |
||
| 32 | } |
||
| 45 |