fix typehint

This commit is contained in:
Dennis Eichhorn 2020-01-25 22:13:29 +01:00
parent 11bea160b9
commit 3f132fb60b
6 changed files with 14 additions and 6 deletions

View File

@ -63,6 +63,7 @@ final class AStar implements PathFinderInterface
break;
}
/** @var AStarNode[] $neighbors */
$neighbors = $grid->getNeighbors($node, $movement);
$neighborsLength = \count($neighbors);
for ($i = 0; $i < $neighborsLength; ++$i) {

View File

@ -175,6 +175,7 @@ class Grid
}
if ($movement === MovementType::STRAIGHT) {
/** @var Node[] $neighbors */
return $neighbors;
}
@ -211,6 +212,7 @@ class Grid
$neighbors[] = $this->getNode($x - 1, $y + 1);
}
/** @var Node[] $neighbors */
return $neighbors;
}
}

View File

@ -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
{
/** @var JumpPointNode[] $neighbors */
$neighbors = self::findNeighbors($node, $movement, $grid);
$neighborsLength = \count($neighbors);
@ -207,6 +208,7 @@ final class JumpPointSearch implements PathFinderInterface
}
}
/** @var JumpPointNode[] $neighbors */
return $neighbors;
}
@ -284,6 +286,7 @@ final class JumpPointSearch implements PathFinderInterface
}
}
/** @var JumpPointNode[] $neighbors */
return $neighbors;
}
@ -357,6 +360,7 @@ final class JumpPointSearch implements PathFinderInterface
}
}
/** @var JumpPointNode[] $neighbors */
return $neighbors;
}
@ -448,6 +452,7 @@ final class JumpPointSearch implements PathFinderInterface
}
}
/** @var JumpPointNode[] $neighbors */
return $neighbors;
}

View File

@ -29,7 +29,7 @@ final class Evaluator
*
* @param string $equation Formula to evaluate
*
* @return float
* @return null|float
*
* @throws \Exception
*

View File

@ -326,7 +326,7 @@ final class Error
$deviation = MeasureOfDispersion::meanDeviation($observed);
foreach ($errors as $error) {
$error[] = $error / $deviation;
$scaled[] = $error / $deviation;
}
return $scaled;

View File

@ -196,8 +196,8 @@ final class Metrics2D
*
* @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<string, int|float> $b 2-D array with x and y coordinate
* @param array<int, int|float> $a 2-D array with x and y coordinate
* @param array<int, int|float> $b 2-D array with x and y coordinate
*
* @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.
*
* @param array<string, int|float> $a Array with elements
* @param array<string, int|float> $b Array with same elements but different order
* @param array<int, int|float> $a Array with elements
* @param array<int, int|float> $b Array with same elements but different order
*
* @return int
*