mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-01 02:18:40 +00:00
fix typehint
This commit is contained in:
parent
11bea160b9
commit
3f132fb60b
|
|
@ -63,6 +63,7 @@ final class AStar implements PathFinderInterface
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var AStarNode[] $neighbors */
|
||||||
$neighbors = $grid->getNeighbors($node, $movement);
|
$neighbors = $grid->getNeighbors($node, $movement);
|
||||||
$neighborsLength = \count($neighbors);
|
$neighborsLength = \count($neighbors);
|
||||||
for ($i = 0; $i < $neighborsLength; ++$i) {
|
for ($i = 0; $i < $neighborsLength; ++$i) {
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,7 @@ class Grid
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($movement === MovementType::STRAIGHT) {
|
if ($movement === MovementType::STRAIGHT) {
|
||||||
|
/** @var Node[] $neighbors */
|
||||||
return $neighbors;
|
return $neighbors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -211,6 +212,7 @@ class Grid
|
||||||
$neighbors[] = $this->getNode($x - 1, $y + 1);
|
$neighbors[] = $this->getNode($x - 1, $y + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var Node[] $neighbors */
|
||||||
return $neighbors;
|
return $neighbors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ final class JumpPointSearch implements PathFinderInterface
|
||||||
*/
|
*/
|
||||||
public static function identifySuccessors(JumpPointNode $node, Grid $grid, int $heuristic, int $movement, JumpPointNode $endNode, Heap $openList) : Heap
|
public static function identifySuccessors(JumpPointNode $node, Grid $grid, int $heuristic, int $movement, JumpPointNode $endNode, Heap $openList) : Heap
|
||||||
{
|
{
|
||||||
|
/** @var JumpPointNode[] $neighbors */
|
||||||
$neighbors = self::findNeighbors($node, $movement, $grid);
|
$neighbors = self::findNeighbors($node, $movement, $grid);
|
||||||
$neighborsLength = \count($neighbors);
|
$neighborsLength = \count($neighbors);
|
||||||
|
|
||||||
|
|
@ -207,6 +208,7 @@ final class JumpPointSearch implements PathFinderInterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var JumpPointNode[] $neighbors */
|
||||||
return $neighbors;
|
return $neighbors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -284,6 +286,7 @@ final class JumpPointSearch implements PathFinderInterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var JumpPointNode[] $neighbors */
|
||||||
return $neighbors;
|
return $neighbors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -357,6 +360,7 @@ final class JumpPointSearch implements PathFinderInterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var JumpPointNode[] $neighbors */
|
||||||
return $neighbors;
|
return $neighbors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -448,6 +452,7 @@ final class JumpPointSearch implements PathFinderInterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var JumpPointNode[] $neighbors */
|
||||||
return $neighbors;
|
return $neighbors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ final class Evaluator
|
||||||
*
|
*
|
||||||
* @param string $equation Formula to evaluate
|
* @param string $equation Formula to evaluate
|
||||||
*
|
*
|
||||||
* @return float
|
* @return null|float
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -326,7 +326,7 @@ final class Error
|
||||||
$deviation = MeasureOfDispersion::meanDeviation($observed);
|
$deviation = MeasureOfDispersion::meanDeviation($observed);
|
||||||
|
|
||||||
foreach ($errors as $error) {
|
foreach ($errors as $error) {
|
||||||
$error[] = $error / $deviation;
|
$scaled[] = $error / $deviation;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $scaled;
|
return $scaled;
|
||||||
|
|
|
||||||
|
|
@ -196,8 +196,8 @@ final class Metrics2D
|
||||||
*
|
*
|
||||||
* @latex d(p, q) = \sum_{n=1}^N{|p_i - q_i|}
|
* @latex d(p, q) = \sum_{n=1}^N{|p_i - q_i|}
|
||||||
*
|
*
|
||||||
* @param array<string, int|float> $a 2-D array with x and y coordinate
|
* @param array<int, int|float> $a 2-D array with x and y coordinate
|
||||||
* @param array<string, int|float> $b 2-D array with x and y coordinate
|
* @param array<int, int|float> $b 2-D array with x and y coordinate
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*
|
*
|
||||||
|
|
@ -226,8 +226,8 @@ final class Metrics2D
|
||||||
*
|
*
|
||||||
* In order to use this with objects the objects would have to implement some kind of value representation for comparison.
|
* In order to use this with objects the objects would have to implement some kind of value representation for comparison.
|
||||||
*
|
*
|
||||||
* @param array<string, int|float> $a Array with elements
|
* @param array<int, int|float> $a Array with elements
|
||||||
* @param array<string, int|float> $b Array with same elements but different order
|
* @param array<int, int|float> $b Array with same elements but different order
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user