From c9ebd9f053accf45baefcef9b6a6903bc2c366b6 Mon Sep 17 00:00:00 2001 From: Hugo_ <55756021+Dhaiven@users.noreply.github.com> Date: Mon, 2 Dec 2024 18:40:58 +0100 Subject: [PATCH] Remove unrealated changes --- src/Facing.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Facing.php b/src/Facing.php index 90fd1b2..7c583fd 100644 --- a/src/Facing.php +++ b/src/Facing.php @@ -50,7 +50,7 @@ public function axis() : Axis{ } /** - * @phpstan-return non-empty-array + * @phpstan-return array{-1|0|1, -1|0|1, -1|0|1} */ public function offset() : array{ return match($this){ @@ -87,7 +87,7 @@ public function opposite() : Facing{ /** * Rotates the given direction around the axis. * - * @throws \InvalidArgumentException + * @throws \InvalidArgumentException if not possible to rotate this direction around $axis */ public function rotate(Axis $axis, bool $clockwise) : Facing{ $rotated = match($axis){ @@ -96,21 +96,21 @@ public function rotate(Axis $axis, bool $clockwise) : Facing{ 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)) + default => throw new \InvalidArgumentException("Cannot rotate facing \"" . strtolower($this->name) . "\" around axis \"" . strtolower($axis->name) . "\"") }, 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)) + default => throw new \InvalidArgumentException("Cannot rotate facing \"" . strtolower($this->name) . "\" around axis \"" . strtolower($axis->name) . "\"") }, Axis::X => match($this){ self::UP => self::NORTH, self::NORTH => self::DOWN, self::DOWN => self::SOUTH, self::SOUTH => self::UP, - default => throw new \InvalidArgumentException("Face " . strtolower($this->name) . " not match with Axis " . strtolower($axis->name)) + default => throw new \InvalidArgumentException("Cannot rotate facing \"" . strtolower($this->name) . "\" around axis \"" . strtolower($axis->name) . "\"") } };