mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
add some phpstan array types
This commit is contained in:
@ -102,6 +102,7 @@ abstract class BaseRail extends Flowable{
|
||||
/**
|
||||
* @param int[] $connections
|
||||
* @param int[][] $lookup
|
||||
* @phpstan-param array<int, list<int>> $lookup
|
||||
*/
|
||||
protected static function searchState(array $connections, array $lookup) : int{
|
||||
$meta = array_search($connections, $lookup, true);
|
||||
@ -170,6 +171,7 @@ abstract class BaseRail extends Flowable{
|
||||
* @param int[] $constraints
|
||||
*
|
||||
* @return true[]
|
||||
* @phpstan-return array<int, true>
|
||||
*/
|
||||
private function getPossibleConnectionDirections(array $constraints) : array{
|
||||
switch(count($constraints)){
|
||||
@ -197,6 +199,7 @@ abstract class BaseRail extends Flowable{
|
||||
|
||||
/**
|
||||
* @return true[]
|
||||
* @phpstan-return array<int, true>
|
||||
*/
|
||||
protected function getPossibleConnectionDirectionsOneConstraint(int $constraint) : array{
|
||||
$opposite = Vector3::getOppositeSide($constraint & ~self::FLAG_ASCEND);
|
||||
|
@ -70,6 +70,7 @@ class Leaves extends Transparent{
|
||||
|
||||
/**
|
||||
* @param true[] $visited reference parameter
|
||||
* @phpstan-param array<string, true> $visited
|
||||
*/
|
||||
protected function findLog(Block $pos, array &$visited, int $distance, ?int $fromSide = null) : bool{
|
||||
$index = $pos->x . "." . $pos->y . "." . $pos->z;
|
||||
|
Reference in New Issue
Block a user