Skip to content

Commit

Permalink
formatting tidy
Browse files Browse the repository at this point in the history
I was going to submit these as review comments, but it's less effort if i just fix them directly
  • Loading branch information
dktapps authored Dec 2, 2024
1 parent 9f734d4 commit c1ccf1e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Facing.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -53,7 +53,7 @@ public function axis() : Axis{
* @phpstan-return non-empty-array<int>
*/
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],
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -146,4 +146,4 @@ public function rotateZ(bool $clockwise) : Facing{
public function rotateX(bool $clockwise) : Facing{
return $this->rotate(Axis::X, $clockwise);
}
}
}

0 comments on commit c1ccf1e

Please sign in to comment.