| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | 3 | protected static function getNeighbors(Config $config) |
|
| 47 | { |
||
| 48 | 3 | $neighbors = []; |
|
| 49 | |||
| 50 | 3 | for ($row = 0; $row < $config->rows(); $row++) { |
|
| 51 | 3 | for ($column = 0; $column < $config->columns(); $column++) { |
|
| 52 | 3 | $coordinate = new Coordinate($row, $column, $config->columns()); |
|
| 53 | |||
| 54 | 3 | $neighborhood = new Neighborhood($config, $coordinate); |
|
| 55 | |||
| 56 | 3 | $neighbors[$coordinate->position()] = $neighborhood->getNeighbors(); |
|
| 57 | } |
||
| 58 | } |
||
| 59 | |||
| 60 | 3 | return $neighbors; |
|
| 61 | } |
||
| 63 |