From c1ccf1e7e93e7e69407774c30fae3fee8ca55b40 Mon Sep 17 00:00:00 2001 From: "Dylan T." Date: Mon, 2 Dec 2024 16:31:03 +0000 Subject: [PATCH] formatting tidy I was going to submit these as review comments, but it's less effort if i just fix them directly --- src/Facing.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Facing.php b/src/Facing.php index 8552283..90fd1b2 100644 --- a/src/Facing.php +++ b/src/Facing.php @@ -42,7 +42,7 @@ enum Facing{ * Returns the axis of the given direction. */ public function axis() : Axis{ - return match ($this) { + return match($this){ self::DOWN, self::UP => Axis::Y, self::NORTH, self::SOUTH => Axis::Z, self::WEST, self::EAST => Axis::X, @@ -53,7 +53,7 @@ public function axis() : Axis{ * @phpstan-return non-empty-array */ public function offset() : array{ - return match ($this) { + return match($this){ self::DOWN => [ 0, -1, 0], self::UP => [ 0, +1, 0], self::NORTH => [ 0, 0, -1], @@ -74,7 +74,7 @@ public function isPositive() : bool{ * Returns the opposite Facing of the specified one. */ public function opposite() : Facing{ - return match ($this) { + return match($this){ self::DOWN => self::UP, self::UP => self::DOWN, self::NORTH => self::SOUTH, @@ -90,22 +90,22 @@ public function opposite() : Facing{ * @throws \InvalidArgumentException */ public function rotate(Axis $axis, bool $clockwise) : Facing{ - $rotated = match ($axis) { - Axis::Y => match ($this) { + $rotated = match($axis){ + Axis::Y => match($this){ self::NORTH => self::EAST, self::EAST => self::SOUTH, self::SOUTH => self::WEST, self::WEST => self::NORTH, default => throw new \InvalidArgumentException("Face " . strtolower($this->name) . " not match with Axis " . strtolower($axis->name)) }, - Axis::Z => match ($this) { + Axis::Z => match($this){ self::UP => self::EAST, self::EAST => self::DOWN, self::DOWN => self::WEST, self::WEST => self::UP, default => throw new \InvalidArgumentException("Face " . strtolower($this->name) . " not match with Axis " . strtolower($axis->name)) }, - Axis::X => match ($this) { + Axis::X => match($this){ self::UP => self::NORTH, self::NORTH => self::DOWN, self::DOWN => self::SOUTH, @@ -146,4 +146,4 @@ public function rotateZ(bool $clockwise) : Facing{ public function rotateX(bool $clockwise) : Facing{ return $this->rotate(Axis::X, $clockwise); } -} \ No newline at end of file +}