Skip to content

Commit

Permalink
Fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhaiven committed May 12, 2024
1 parent 54d40bb commit 7857d74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/AxisAlignedBB.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public function calculateIntercept(Vector3 $pos1, Vector3 $pos2) : ?RayTraceResu

$vector = null;
$distance = PHP_INT_MAX;
$face = -1;
$face = null;

foreach([
[Facing::WEST, $v1],
Expand All @@ -468,6 +468,7 @@ public function calculateIntercept(Vector3 $pos1, Vector3 $pos2) : ?RayTraceResu
if($v !== null and ($d = $pos1->distanceSquared($v)) < $distance){
$vector = $v;
$distance = $d;
/** @var Facing $face */
$face = $value[0];
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/Vector3.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ public function east(int $step = 1){
*
* @param int $step Distance in each direction to shift the vector
*
* @return \Generator|array
* @phpstan-return \Generator<Facing, Vector3, void, void>
* @return \Generator|mixed[] [Facing $facing, Vector3 $vector]
* @phpstan-return \Generator<int, array{Facing, Vector3}, void, void>
*/
public function sides(int $step = 1) : \Generator{
foreach(Facing::cases() as $facing){
Expand All @@ -182,7 +182,7 @@ public function sides(int $step = 1) : \Generator{
/**
* Same as sides() but returns a pre-populated array instead of Generator.
*
* @return Vector3[]
* @return array{Facing, Vector3}
*/
public function sidesArray(bool $keys = false, int $step = 1) : array{
return iterator_to_array($this->sides($step), $keys);

Check failure on line 188 in src/Vector3.php

View workflow job for this annotation

GitHub Actions / PHP 8.1

Method pocketmine\math\Vector3::sidesArray() should return array{pocketmine\math\Facing, pocketmine\math\Vector3} but returns array<int, array{pocketmine\math\Facing, pocketmine\math\Vector3}>.

Check failure on line 188 in src/Vector3.php

View workflow job for this annotation

GitHub Actions / PHP 8.2

Method pocketmine\math\Vector3::sidesArray() should return array{pocketmine\math\Facing, pocketmine\math\Vector3} but returns array<int, array{pocketmine\math\Facing, pocketmine\math\Vector3}>.

Check failure on line 188 in src/Vector3.php

View workflow job for this annotation

GitHub Actions / PHP 8.3

Method pocketmine\math\Vector3::sidesArray() should return array{pocketmine\math\Facing, pocketmine\math\Vector3} but returns array<int, array{pocketmine\math\Facing, pocketmine\math\Vector3}>.
Expand All @@ -191,8 +191,8 @@ public function sidesArray(bool $keys = false, int $step = 1) : array{
/**
* Yields vectors stepped out from this one in directions except those on the given axis.
*
* @return \Generator|array
* @phpstan-return \Generator<Facing, Vector3, void, void>
* @return \Generator|mixed[] [Facing $facing, Vector3 $vector]
* @phpstan-return \Generator<int, array{Facing, Vector3}, void, void>
*/
public function sidesAroundAxis(Axis $axis, int $step = 1) : \Generator{
foreach(Facing::cases() as $facing){
Expand Down

0 comments on commit 7857d74

Please sign in to comment.