@@ -42,7 +42,7 @@ enum Facing{
42
42
* Returns the axis of the given direction.
43
43
*/
44
44
public function axis () : Axis {
45
- return match ($ this ) {
45
+ return match ($ this ){
46
46
self ::DOWN , self ::UP => Axis::Y,
47
47
self ::NORTH , self ::SOUTH => Axis::Z,
48
48
self ::WEST , self ::EAST => Axis::X,
@@ -53,7 +53,7 @@ public function axis() : Axis{
53
53
* @phpstan-return non-empty-array<int>
54
54
*/
55
55
public function offset () : array {
56
- return match ($ this ) {
56
+ return match ($ this ){
57
57
self ::DOWN => [ 0 , -1 , 0 ],
58
58
self ::UP => [ 0 , +1 , 0 ],
59
59
self ::NORTH => [ 0 , 0 , -1 ],
@@ -74,7 +74,7 @@ public function isPositive() : bool{
74
74
* Returns the opposite Facing of the specified one.
75
75
*/
76
76
public function opposite () : Facing {
77
- return match ($ this ) {
77
+ return match ($ this ){
78
78
self ::DOWN => self ::UP ,
79
79
self ::UP => self ::DOWN ,
80
80
self ::NORTH => self ::SOUTH ,
@@ -90,22 +90,22 @@ public function opposite() : Facing{
90
90
* @throws \InvalidArgumentException
91
91
*/
92
92
public function rotate (Axis $ axis , bool $ clockwise ) : Facing {
93
- $ rotated = match ($ axis ) {
94
- Axis::Y => match ($ this ) {
93
+ $ rotated = match ($ axis ){
94
+ Axis::Y => match ($ this ){
95
95
self ::NORTH => self ::EAST ,
96
96
self ::EAST => self ::SOUTH ,
97
97
self ::SOUTH => self ::WEST ,
98
98
self ::WEST => self ::NORTH ,
99
99
default => throw new \InvalidArgumentException ("Face " . strtolower ($ this ->name ) . " not match with Axis " . strtolower ($ axis ->name ))
100
100
},
101
- Axis::Z => match ($ this ) {
101
+ Axis::Z => match ($ this ){
102
102
self ::UP => self ::EAST ,
103
103
self ::EAST => self ::DOWN ,
104
104
self ::DOWN => self ::WEST ,
105
105
self ::WEST => self ::UP ,
106
106
default => throw new \InvalidArgumentException ("Face " . strtolower ($ this ->name ) . " not match with Axis " . strtolower ($ axis ->name ))
107
107
},
108
- Axis::X => match ($ this ) {
108
+ Axis::X => match ($ this ){
109
109
self ::UP => self ::NORTH ,
110
110
self ::NORTH => self ::DOWN ,
111
111
self ::DOWN => self ::SOUTH ,
@@ -146,4 +146,4 @@ public function rotateZ(bool $clockwise) : Facing{
146
146
public function rotateX (bool $ clockwise ) : Facing {
147
147
return $ this ->rotate (Axis::X, $ clockwise );
148
148
}
149
- }
149
+ }
0 commit comments