Conditions | 5 |
Paths | 5 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 5.025 |
Changes | 0 |
1 | <?php |
||
73 | 6 | public function inverseDirection(): Direction |
|
74 | { |
||
75 | 6 | if ($this->equals(self::north())) { |
|
76 | 3 | return self::south(); |
|
77 | } |
||
78 | 3 | if ($this->equals(self::east())) { |
|
79 | 1 | return self::west(); |
|
80 | } |
||
81 | 2 | if ($this->equals(self::south())) { |
|
82 | 1 | return self::north(); |
|
83 | } |
||
84 | 1 | if ($this->equals(self::west())) { |
|
85 | 1 | return self::east(); |
|
86 | } |
||
87 | } |
||
88 | |||
98 |