mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 01:38:41 +00:00
improve array docblock
This commit is contained in:
parent
caa78ed9d5
commit
59f43a6a87
|
|
@ -51,8 +51,8 @@ class Point implements PointInterface
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $coordinates Coordinates of the point
|
||||
* @param string $name Name of the point
|
||||
* @param array<int, int|float> $coordinates Coordinates of the point
|
||||
* @param string $name Name of the point
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class MazeGenerator
|
|||
/**
|
||||
* Render a maze
|
||||
*
|
||||
* @param array $maze Maze to render
|
||||
* @param array<int, int[]> $maze Maze to render
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
|
|
|
|||
|
|
@ -35,7 +35,30 @@ class Grid
|
|||
/**
|
||||
* Create a grid from an array
|
||||
*
|
||||
* @param array $gridArray Grid defined in an array (0 = empty, 1 = start, 2 = end, 9 = not walkable)
|
||||
* [
|
||||
* [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],
|
||||
* [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,],
|
||||
* [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],
|
||||
* [0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,],
|
||||
* [0, 0, 0, 0, 9, 9, 9, 9, 9, 0, 9, 0, 0, 0, 0,],
|
||||
* [0, 0, 1, 0, 9, 0, 0, 0, 0, 0, 9, 0, 9, 9, 9,],
|
||||
* [0, 0, 0, 0, 9, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0,],
|
||||
* [0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],
|
||||
* [0, 0, 0, 9, 0, 0, 0, 9, 0, 0, 9, 9, 9, 9, 0,],
|
||||
* [0, 0, 0, 9, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0,],
|
||||
* [0, 0, 0, 9, 0, 0, 0, 9, 0, 0, 9, 9, 0, 0, 0,],
|
||||
* [0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 9, 2, 0, 0, 0,],
|
||||
* [0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 9, 9, 0, 0, 0,],
|
||||
* [0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,],
|
||||
* [0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,],
|
||||
* ]
|
||||
*
|
||||
* @param array<int, int[]> $gridArray Grid defined in an array (0 = empty, 1 = start, 2 = end, 9 = not walkable)
|
||||
* @param string $node Node type name
|
||||
*
|
||||
* @return Grid
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function createGridFromArray(array $gridArray, string $node) : self
|
||||
{
|
||||
|
|
@ -111,7 +134,7 @@ class Grid
|
|||
* @param Node $node Node to get neighbors from
|
||||
* @param int $movement Allowed movements
|
||||
*
|
||||
* @return array
|
||||
* @return Node[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ final class Heuristic
|
|||
/**
|
||||
* Calculate metric/distance between two nodes.
|
||||
*
|
||||
* @param array $node1 Array with 'x' and 'y' coordinate
|
||||
* @param array $node2 Array with 'x' and 'y' coordinate
|
||||
* @param int $heuristic Heuristic to use for calculation
|
||||
* @param array<string, int|float> $node1 Array with 'x' and 'y' coordinate
|
||||
* @param array<string, int|float> $node2 Array with 'x' and 'y' coordinate
|
||||
* @param int $heuristic Heuristic to use for calculation
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ final class JumpPointSearch implements PathFinderInterface
|
|||
* @param int $movement Movement type
|
||||
* @param Grid $grid Grid of the nodes
|
||||
*
|
||||
* @return array Neighbors of node
|
||||
* @return Node[] Neighbors of node
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -159,7 +159,7 @@ final class JumpPointSearch implements PathFinderInterface
|
|||
* @param JumpPointNode $node Node to find successor for
|
||||
* @param Grid $grid Grid of the nodes
|
||||
*
|
||||
* @return array Neighbors of node
|
||||
* @return Node[] Neighbors of node
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -216,7 +216,7 @@ final class JumpPointSearch implements PathFinderInterface
|
|||
* @param JumpPointNode $node Node to find successor for
|
||||
* @param Grid $grid Grid of the nodes
|
||||
*
|
||||
* @return array Neighbors of node
|
||||
* @return Node[] Neighbors of node
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -293,7 +293,7 @@ final class JumpPointSearch implements PathFinderInterface
|
|||
* @param JumpPointNode $node Node to find successor for
|
||||
* @param Grid $grid Grid of the nodes
|
||||
*
|
||||
* @return array Neighbors of node
|
||||
* @return Node[] Neighbors of node
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -366,7 +366,7 @@ final class JumpPointSearch implements PathFinderInterface
|
|||
* @param JumpPointNode $node Node to find successor for
|
||||
* @param Grid $grid Grid of the nodes
|
||||
*
|
||||
* @return array Neighbors of node
|
||||
* @return Node[] Neighbors of node
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ class Node
|
|||
/**
|
||||
* Get the coordinates of this node.
|
||||
*
|
||||
* @return array ['x' => ?, 'y' => ?]
|
||||
* @return array<string, int> ['x' => ?, 'y' => ?]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ final class L11nManager
|
|||
* @param string $language Language iso code
|
||||
* @param string $module Module name
|
||||
*
|
||||
* @return array
|
||||
* @return array<string, string>|array<string, array<string, string>>
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ class Localization
|
|||
/**
|
||||
* get datetime format
|
||||
*
|
||||
* @return array
|
||||
* @return array<string, string>
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -365,7 +365,7 @@ class Localization
|
|||
/**
|
||||
* Set datetime format
|
||||
*
|
||||
* @param array $datetime Datetime format
|
||||
* @param array<string, string> $datetime Datetime format
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class Matrix implements \ArrayAccess, \Iterator
|
|||
* @param int $m Row
|
||||
* @param int $n Column
|
||||
*
|
||||
* @return mixed
|
||||
* @return int|float
|
||||
*
|
||||
* @throws InvalidDimensionException
|
||||
*
|
||||
|
|
@ -176,8 +176,8 @@ class Matrix implements \ArrayAccess, \Iterator
|
|||
/**
|
||||
* Get sub matrix array.
|
||||
*
|
||||
* @param array<int> $rows Row indices
|
||||
* @param array<int> $cols Row indices
|
||||
* @param int[] $rows Row indices
|
||||
* @param int[] $cols Row indices
|
||||
*
|
||||
* @return Matrix
|
||||
*
|
||||
|
|
@ -204,9 +204,9 @@ class Matrix implements \ArrayAccess, \Iterator
|
|||
/**
|
||||
* Get sub matrix array.
|
||||
*
|
||||
* @param int $iRow Start row
|
||||
* @param int $lRow End row
|
||||
* @param array<int> $cols Row indices
|
||||
* @param int $iRow Start row
|
||||
* @param int $lRow End row
|
||||
* @param int[] $cols Row indices
|
||||
*
|
||||
* @return Matrix
|
||||
*
|
||||
|
|
@ -232,9 +232,9 @@ class Matrix implements \ArrayAccess, \Iterator
|
|||
/**
|
||||
* Get sub matrix array.
|
||||
*
|
||||
* @param array<int> $rows Row indices
|
||||
* @param int $iCol Start col
|
||||
* @param int $lCol End col
|
||||
* @param int[] $rows Row indices
|
||||
* @param int $iCol Start col
|
||||
* @param int $lCol End col
|
||||
*
|
||||
* @return Matrix
|
||||
*
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ final class Vector extends Matrix
|
|||
*
|
||||
* @param int $m Position to get
|
||||
*
|
||||
* @return mixed
|
||||
* @return int|float
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -56,7 +56,7 @@ final class Vector extends Matrix
|
|||
/**
|
||||
* Set matrix
|
||||
*
|
||||
* @param array $vector 1-Dimensional array
|
||||
* @param array<int, int|float> $vector 1-Dimensional array
|
||||
*
|
||||
* @return Vector
|
||||
*
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ final class Integer
|
|||
* @param int $value Integer to factorize
|
||||
* @param int $limit Max amount of iterations
|
||||
*
|
||||
* @return array<int>
|
||||
* @return int[]
|
||||
*
|
||||
* @throws \Exception This exception is thrown if the value is not odd
|
||||
*
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ final class LagrangeInterpolation implements InterpolationInterface
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $points Points to create the interpolation with
|
||||
* @param array<int, array<string, int|float>> $points Points to create the interpolation with
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ final class Evaluator
|
|||
*
|
||||
* @param string $equation Equation to convert
|
||||
*
|
||||
* @return array<int, string>
|
||||
* @return string[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -147,7 +147,7 @@ final class Evaluator
|
|||
$output[] = \array_pop($stack);
|
||||
}
|
||||
|
||||
/** @var array<int, string> $output */
|
||||
/** @var string[] $output */
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ final class Average
|
|||
* @param array<int, float|int> $weight Weight for moving average
|
||||
* @param bool $symmetric Cyclic moving average
|
||||
*
|
||||
* @return array Moving average of data
|
||||
* @return float[] Moving average of data
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
|
|
|
|||
|
|
@ -78,9 +78,9 @@ final class Correlation
|
|||
/**
|
||||
* Box Pierce test (portmanteau test).
|
||||
*
|
||||
* @param array<float> $autocorrelations Autocorrelations
|
||||
* @param int $h Maximum leg considered
|
||||
* @param int $n Amount of observations
|
||||
* @param float[] $autocorrelations Autocorrelations
|
||||
* @param int $h Maximum leg considered
|
||||
* @param int $n Amount of observations
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -99,9 +99,9 @@ final class Correlation
|
|||
/**
|
||||
* Ljung Box test (portmanteau test).
|
||||
*
|
||||
* @param array<float> $autocorrelations Autocorrelations
|
||||
* @param int $h Maximum leg considered
|
||||
* @param int $n Amount of observations
|
||||
* @param float[] $autocorrelations Autocorrelations
|
||||
* @param int $h Maximum leg considered
|
||||
* @param int $n Amount of observations
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
|
|||
|
|
@ -57,10 +57,10 @@ final class Error
|
|||
/**
|
||||
* Get array of errors of a forecast.
|
||||
*
|
||||
* @param array $observed Dataset
|
||||
* @param array $forecasted Forecasted
|
||||
* @param float[] $observed Dataset
|
||||
* @param float[] $forecasted Forecasted
|
||||
*
|
||||
* @return array
|
||||
* @return float[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -93,10 +93,10 @@ final class Error
|
|||
/**
|
||||
* Get error percentages.
|
||||
*
|
||||
* @param array $errors Errors
|
||||
* @param array $observed Dataset
|
||||
* @param float[] $errors Errors
|
||||
* @param float[] $observed Dataset
|
||||
*
|
||||
* @return array
|
||||
* @return float[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -114,7 +114,7 @@ final class Error
|
|||
/**
|
||||
* Get mean absolute error (MAE).
|
||||
*
|
||||
* @param array $errors Errors
|
||||
* @param array<int, int|float> $errors Errors
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -128,8 +128,8 @@ final class Error
|
|||
/**
|
||||
* Get mean squared error (MSE).
|
||||
*
|
||||
* @param array $errors Errors
|
||||
* @param int $offset Population/Size offset
|
||||
* @param array<int, int|float> $errors Errors
|
||||
* @param int $offset Population/Size offset
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -143,7 +143,7 @@ final class Error
|
|||
/**
|
||||
* Get root mean squared error (RMSE).
|
||||
*
|
||||
* @param array $errors Errors
|
||||
* @param array<int, int|float> $errors Errors
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -161,8 +161,8 @@ final class Error
|
|||
*
|
||||
* @latex R^{2} = \frac{\sum \left(\hat{y}_{i} - \bar{y}\right)^2}{\sum \left(y_{i} - \bar{y}\right)^2}
|
||||
*
|
||||
* @param array $observed Obersved y values
|
||||
* @param array $forecasted Forecasted y values
|
||||
* @param float[] $observed Obersved y values
|
||||
* @param float[] $forecasted Forecasted y values
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -176,7 +176,7 @@ final class Error
|
|||
/**
|
||||
* Get sum squared error (SSE).
|
||||
*
|
||||
* @param array $errors Errors
|
||||
* @param array<int, int|float> $errors Errors
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -268,8 +268,8 @@ final class Error
|
|||
/**
|
||||
* Get mean absolute percentage error (MAPE).
|
||||
*
|
||||
* @param array $observed Dataset
|
||||
* @param array $forecasted Forecasted
|
||||
* @param float[] $observed Dataset
|
||||
* @param float[] $forecasted Forecasted
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -286,8 +286,8 @@ final class Error
|
|||
/**
|
||||
* Get mean absolute percentage error (sMAPE).
|
||||
*
|
||||
* @param array $observed Dataset
|
||||
* @param array $forecasted Forecasted
|
||||
* @param float[] $observed Dataset
|
||||
* @param float[] $forecasted Forecasted
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -310,10 +310,10 @@ final class Error
|
|||
/**
|
||||
* Get cross sectional scaled errors (CSSE)
|
||||
*
|
||||
* @param array $errors Errors
|
||||
* @param array $observed Dataset
|
||||
* @param array<int, int|float> $errors Errors
|
||||
* @param float[] $observed Dataset
|
||||
*
|
||||
* @return array
|
||||
* @return float[]
|
||||
*
|
||||
* @todo Orange-Management/phpOMS#172
|
||||
* Create unit test.
|
||||
|
|
@ -335,8 +335,8 @@ final class Error
|
|||
/**
|
||||
* Get cross sectional scaled errors (CSSE)
|
||||
*
|
||||
* @param float $error Errors
|
||||
* @param array $observed Dataset
|
||||
* @param float $error Errors
|
||||
* @param float[] $observed Dataset
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -360,7 +360,7 @@ final class Error
|
|||
/**
|
||||
* Get mean absolute scaled error (MASE)
|
||||
*
|
||||
* @param array $scaledErrors Scaled errors
|
||||
* @param array<int, int|float> $scaledErrors Scaled errors
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -374,7 +374,7 @@ final class Error
|
|||
/**
|
||||
* Get mean absolute scaled error (MSSE)
|
||||
*
|
||||
* @param array $scaledErrors Scaled errors
|
||||
* @param array<int, int|float> $scaledErrors Scaled errors
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -391,9 +391,9 @@ final class Error
|
|||
/**
|
||||
* Get scaled error (SE)
|
||||
*
|
||||
* @param array $errors Errors
|
||||
* @param array $observed Dataset
|
||||
* @param int $m Shift
|
||||
* @param array<int, int|float> $errors Errors
|
||||
* @param float[] $observed Dataset
|
||||
* @param int $m Shift
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
|
|
@ -414,9 +414,9 @@ final class Error
|
|||
/**
|
||||
* Get scaled error (SE)
|
||||
*
|
||||
* @param float $error Errors
|
||||
* @param array $observed Dataset
|
||||
* @param int $m Shift
|
||||
* @param float $error Errors
|
||||
* @param float[] $observed Dataset
|
||||
* @param int $m Shift
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -430,8 +430,8 @@ final class Error
|
|||
/**
|
||||
* Get naive forecast
|
||||
*
|
||||
* @param array $observed Dataset
|
||||
* @param int $m Shift
|
||||
* @param float[] $observed Dataset
|
||||
* @param int $m Shift
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ final class Metrics2D
|
|||
*
|
||||
* @latex d(p, q) = \sum_{n=1}^N{|p_i - q_i|}
|
||||
*
|
||||
* @param array $a 2-D array with x and y coordinate
|
||||
* @param array $b 2-D array with x and y coordinate
|
||||
* @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
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -59,8 +59,8 @@ final class Metrics2D
|
|||
*
|
||||
* @latex d(p, q) = \sqrt{\sum_{n=1}^N{(p_i - q_i)^2}}
|
||||
*
|
||||
* @param array $a 2-D array with x and y coordinate
|
||||
* @param array $b 2-D array with x and y coordinate
|
||||
* @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
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -79,8 +79,8 @@ final class Metrics2D
|
|||
*
|
||||
* @latex d(p, q) = \begin{cases}(\sqrt{2} - 1) \times |p_i - q_i| + |p_{i+1} - q_{i+1}|,& \text{if } |p_i - q_i| < |p_{i+1} - q_{i+1}|\\(\sqrt{2} - 1) \times |p_{i+1} - q_{i+1}| + |p_i - q_i|,&\text{if } |p_i - q_i| \geq |p_{i+1} - q_{i+1}|\end{cases}
|
||||
*
|
||||
* @param array $a 2-D array with x and y coordinate
|
||||
* @param array $b 2-D array with x and y coordinate
|
||||
* @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
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -99,8 +99,8 @@ final class Metrics2D
|
|||
*
|
||||
* @latex d(p, q) = \max_i{(|p_i - q_i|)}
|
||||
*
|
||||
* @param array $a 2-D array with x and y coordinate
|
||||
* @param array $b 2-D array with x and y coordinate
|
||||
* @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
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -119,8 +119,8 @@ final class Metrics2D
|
|||
*
|
||||
* @latex d(p, q) = \sqrt[\lambda]{\sum_{n=1}^N{|p_i - q_i|^\lambda}}
|
||||
*
|
||||
* @param array $a 2-D array with x and y coordinate
|
||||
* @param array $b 2-D array with x and y coordinate
|
||||
* @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 int $lambda Lambda
|
||||
*
|
||||
* @return float
|
||||
|
|
@ -141,8 +141,8 @@ final class Metrics2D
|
|||
*
|
||||
* @latex d(p, q) = \sum_{n=1}^N{\frac{|p_i - q_i|}{|p_i| + |q_i|}
|
||||
*
|
||||
* @param array $a 2-D array with x and y coordinate
|
||||
* @param array $b 2-D array with x and y coordinate
|
||||
* @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
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -159,8 +159,8 @@ final class Metrics2D
|
|||
*
|
||||
* @latex d(p, q) = \frac{\sum_{n=1}^N{|p_i - q_i|}}{\sum_{n=1}^N{(p_i + q_i)}}
|
||||
*
|
||||
* @param array $a 2-D array with x and y coordinate
|
||||
* @param array $b 2-D array with x and y coordinate
|
||||
* @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
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -179,8 +179,8 @@ final class Metrics2D
|
|||
*
|
||||
* @latex d(p, q) = \frac{\sum_{n=1}^N{p_i * q_i}}{\left(\sum_{n=1}^N{p_i^2} * \sum_{n=1}^N{q_i^2}\right)^\frac{1}{2}}
|
||||
*
|
||||
* @param array $a 2-D array with x and y coordinate
|
||||
* @param array $b 2-D array with x and y coordinate
|
||||
* @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
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -196,8 +196,8 @@ final class Metrics2D
|
|||
*
|
||||
* @latex d(p, q) = \sum_{n=1}^N{|p_i - q_i|}
|
||||
*
|
||||
* @param array $a 2-D array with x and y coordinate
|
||||
* @param array $b 2-D array with x and y coordinate
|
||||
* @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
|
||||
*
|
||||
* @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 $a Array with elements
|
||||
* @param array $b Array with same elements but different order
|
||||
* @param array<string, int|float> $a Array with elements
|
||||
* @param array<string, int|float> $b Array with same elements but different order
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ final class MetricsND
|
|||
*
|
||||
* @latex d(p, q) = \sum_{n=1}^N{|p_i - q_i|}
|
||||
*
|
||||
* @param array $a n-D array
|
||||
* @param array $b n-D array
|
||||
* @param array<int|string, int|float> $a n-D array
|
||||
* @param array<int|string, int|float> $b n-D array
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -68,8 +68,8 @@ final class MetricsND
|
|||
*
|
||||
* @latex d(p, q) = \sqrt{\sum_{n=1}^N{(p_i - q_i)^2}}
|
||||
*
|
||||
* @param array $a n-D array
|
||||
* @param array $b n-D array
|
||||
* @param array<int|string, int|float> $a n-D array
|
||||
* @param array<int|string, int|float> $b n-D array
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -94,8 +94,8 @@ final class MetricsND
|
|||
*
|
||||
* @latex d(p, q) = \max_i{(|p_i - q_i|)}
|
||||
*
|
||||
* @param array $a n-D array
|
||||
* @param array $b n-D array
|
||||
* @param array<int|string, int|float> $a n-D array
|
||||
* @param array<int|string, int|float> $b n-D array
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -120,8 +120,8 @@ final class MetricsND
|
|||
*
|
||||
* @latex d(p, q) = \sqrt[\lambda]{\sum_{n=1}^N{|p_i - q_i|^\lambda}}
|
||||
*
|
||||
* @param array $a n-D array
|
||||
* @param array $b n-D array
|
||||
* @param array<int|string, int|float> $a n-D array
|
||||
* @param array<int|string, int|float> $b n-D array
|
||||
* @param int $lambda Lambda
|
||||
*
|
||||
* @return float
|
||||
|
|
@ -147,8 +147,8 @@ final class MetricsND
|
|||
*
|
||||
* @latex d(p, q) = \sum_{n=1}^N{\frac{|p_i - q_i|}{|p_i| + |q_i|}
|
||||
*
|
||||
* @param array $a n-D array
|
||||
* @param array $b n-D array
|
||||
* @param array<int|string, int|float> $a n-D array
|
||||
* @param array<int|string, int|float> $b n-D array
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -173,8 +173,8 @@ final class MetricsND
|
|||
*
|
||||
* @latex d(p, q) = \frac{\sum_{n=1}^N{|p_i - q_i|}}{\sum_{n=1}^N{(p_i + q_i)}}
|
||||
*
|
||||
* @param array $a n-D array
|
||||
* @param array $b n-D array
|
||||
* @param array<int|string, int|float> $a n-D array
|
||||
* @param array<int|string, int|float> $b n-D array
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -201,8 +201,8 @@ final class MetricsND
|
|||
*
|
||||
* @latex d(p, q) = \frac{\sum_{n=1}^N{p_i * q_i}}{\left(\sum_{n=1}^N{p_i^2} * \sum_{n=1}^N{q_i^2}\right)^\frac{1}{2}}
|
||||
*
|
||||
* @param array $a n-D array
|
||||
* @param array $b n-D array
|
||||
* @param array<int|string, int|float> $a n-D array
|
||||
* @param array<int|string, int|float> $b n-D array
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
|
|
@ -231,8 +231,8 @@ final class MetricsND
|
|||
*
|
||||
* @latex d(p, q) = \sum_{n=1}^N{|p_i - q_i|}
|
||||
*
|
||||
* @param array $a n-D array
|
||||
* @param array $b n-D array
|
||||
* @param array<int|string, int|float> $a n-D array
|
||||
* @param array<int|string, int|float> $b n-D array
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ abstract class ModuleAbstract
|
|||
/**
|
||||
* Get modules this module is receiving from
|
||||
*
|
||||
* @return array<int, string>
|
||||
* @return string[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -159,7 +159,7 @@ abstract class ModuleAbstract
|
|||
/**
|
||||
* Get modules this module is providing for
|
||||
*
|
||||
* @return array<int, string>
|
||||
* @return string[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ final class ModuleManager
|
|||
*
|
||||
* This is important to inform other modules what kind of information they can receive from other modules.
|
||||
*
|
||||
* @var array<string, array<int, string>>
|
||||
* @var array<string, string[]>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private array $providing = [];
|
||||
|
|
@ -122,7 +122,7 @@ final class ModuleManager
|
|||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
* @return array<string>
|
||||
* @return string[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -818,7 +818,7 @@ final class ModuleManager
|
|||
*
|
||||
* @param Request $request Request
|
||||
*
|
||||
* @return array<string>
|
||||
* @return string[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ final class PhpCode
|
|||
/**
|
||||
* Check if function is disabled
|
||||
*
|
||||
* @param array<string> $functions Functions to check
|
||||
* @param string[] $functions Functions to check
|
||||
*
|
||||
* @return bool Returns true if code has disabled function calls otherwise false is returned
|
||||
*
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ final class MultiMap implements \Countable
|
|||
|
||||
// prevent adding elements if keys are just ordered differently
|
||||
if ($this->orderType === OrderType::LOOSE) {
|
||||
/** @var array<array<string>> $keysToTest */
|
||||
/** @var array<string[]> $keysToTest */
|
||||
$keysToTest = Permutation::permut($keys, [], false);
|
||||
|
||||
foreach ($keysToTest as $test) {
|
||||
|
|
@ -218,7 +218,7 @@ final class MultiMap implements \Countable
|
|||
{
|
||||
if (\is_array($key)) {
|
||||
if ($this->orderType === OrderType::LOOSE) {
|
||||
/** @var array<array<string>> $keys */
|
||||
/** @var array<string[]> $keys */
|
||||
$keys = Permutation::permut($key, [], false);
|
||||
|
||||
foreach ($keys as $key => $value) {
|
||||
|
|
@ -268,7 +268,7 @@ final class MultiMap implements \Countable
|
|||
private function setMultiple($key, $value) : bool
|
||||
{
|
||||
if ($this->orderType !== OrderType::STRICT) {
|
||||
/** @var array<array<string>> $permutation */
|
||||
/** @var array<string[]> $permutation */
|
||||
$permutation = Permutation::permut($key, [], false);
|
||||
|
||||
foreach ($permutation as $permut) {
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class Directory extends FileAbstract implements FtpContainerInterface, Directory
|
|||
* @param string $path Path
|
||||
* @param string $filter Filter
|
||||
*
|
||||
* @return array<int, string>
|
||||
* @return string[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -96,7 +96,7 @@ class Directory extends FileAbstract implements FtpContainerInterface, Directory
|
|||
}
|
||||
}
|
||||
|
||||
/** @var array<int, string> $list */
|
||||
/** @var string[] $list */
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -199,10 +199,10 @@ interface FtpContainerInterface
|
|||
/**
|
||||
* Count subresources.
|
||||
*
|
||||
* @param resource $con FTP connection
|
||||
* @param string $path Path of the resource
|
||||
* @param bool $recursive Consider subdirectories
|
||||
* @param array<string> $ignore Files/paths to ignore (no regex)
|
||||
* @param resource $con FTP connection
|
||||
* @param string $path Path of the resource
|
||||
* @param bool $recursive Consider subdirectories
|
||||
* @param string[] $ignore Files/paths to ignore (no regex)
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ final class Directory extends FileAbstract implements LocalContainerInterface, D
|
|||
* @param string $path Path
|
||||
* @param string $filter Filter
|
||||
*
|
||||
* @return array<int, string>
|
||||
* @return string[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -95,7 +95,7 @@ final class Directory extends FileAbstract implements LocalContainerInterface, D
|
|||
$list[] = \str_replace('\\', '/', $iterator->getSubPathname());
|
||||
}
|
||||
|
||||
/** @var array<int, string> $list */
|
||||
/** @var string[] $list */
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
|
@ -198,9 +198,9 @@ final class Directory extends FileAbstract implements LocalContainerInterface, D
|
|||
*
|
||||
* A file will always return 1 as it doesn't have any sub-resources.
|
||||
*
|
||||
* @param string $path Path of the resource
|
||||
* @param bool $recursive Should count also sub-sub-resources
|
||||
* @param array<string> $ignore Ignore files
|
||||
* @param string $path Path of the resource
|
||||
* @param bool $recursive Should count also sub-sub-resources
|
||||
* @param string[] $ignore Ignore files
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
|
|
|
|||
|
|
@ -190,9 +190,9 @@ interface LocalContainerInterface
|
|||
/**
|
||||
* Count subresources.
|
||||
*
|
||||
* @param string $path Path of the resource
|
||||
* @param bool $recursive Consider subdirectories
|
||||
* @param array<string> $ignore Files/paths to ignore (no regex)
|
||||
* @param string $path Path of the resource
|
||||
* @param bool $recursive Consider subdirectories
|
||||
* @param string[] $ignore Files/paths to ignore (no regex)
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
|
|
|
|||
|
|
@ -243,9 +243,9 @@ abstract class StorageAbstract
|
|||
/**
|
||||
* Count subresources.
|
||||
*
|
||||
* @param string $path Path of the resource
|
||||
* @param bool $recursive Consider subdirectories
|
||||
* @param array<string> $ignore Files/paths to ignore (no regex)
|
||||
* @param string $path Path of the resource
|
||||
* @param bool $recursive Consider subdirectories
|
||||
* @param string[] $ignore Files/paths to ignore (no regex)
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ final class Http implements UriInterface
|
|||
/**
|
||||
* Path elements.
|
||||
*
|
||||
* @var array
|
||||
* @var string[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private array $pathElements;
|
||||
|
|
@ -113,7 +113,7 @@ final class Http implements UriInterface
|
|||
/**
|
||||
* Uri query.
|
||||
*
|
||||
* @var array
|
||||
* @var array<string, string>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private array $query = [];
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ interface UriInterface
|
|||
/**
|
||||
* Get path elements.
|
||||
*
|
||||
* @return array
|
||||
* @return string[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -175,7 +175,7 @@ interface UriInterface
|
|||
/**
|
||||
* Get query array.
|
||||
*
|
||||
* @return array
|
||||
* @return array<string, string>
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -260,8 +260,8 @@ final class ArrayUtils
|
|||
*
|
||||
* Useful for parsing command line parsing
|
||||
*
|
||||
* @param string $id Id to find
|
||||
* @param array<string> $args CLI command list
|
||||
* @param string $id Id to find
|
||||
* @param string[] $args CLI command list
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
|
|
@ -279,8 +279,8 @@ final class ArrayUtils
|
|||
/**
|
||||
* Check if flag is set
|
||||
*
|
||||
* @param string $id Id to find
|
||||
* @param array<string> $args CLI command list
|
||||
* @param string $id Id to find
|
||||
* @param string[] $args CLI command list
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
|
|
@ -389,7 +389,7 @@ final class ArrayUtils
|
|||
* @param array<float|int> $values Values to square
|
||||
* @param float $exp Exponent
|
||||
*
|
||||
* @return array<float>
|
||||
* @return float[]
|
||||
*
|
||||
* @todo Orange-Management/phpOMS#223
|
||||
* In the ArrayUtils class the power* functions should be combined once union types become available.
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class Repository
|
|||
/**
|
||||
* Get all branches.
|
||||
*
|
||||
* @return array<string>
|
||||
* @return string[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -162,7 +162,7 @@ class Repository
|
|||
*
|
||||
* @param string $cmd Command to run
|
||||
*
|
||||
* @return array<string>
|
||||
* @return string[]
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
|
|
@ -214,7 +214,7 @@ class Repository
|
|||
*
|
||||
* @param string $lines Result of git command
|
||||
*
|
||||
* @return array<string>
|
||||
* @return string[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -466,7 +466,7 @@ class Repository
|
|||
/**
|
||||
* Get all remote branches.
|
||||
*
|
||||
* @return array<string>
|
||||
* @return string[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -644,7 +644,7 @@ class Repository
|
|||
/**
|
||||
* Get LOC.
|
||||
*
|
||||
* @param array<string> $extensions Extensions whitelist
|
||||
* @param string[] $extensions Extensions whitelist
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class File
|
|||
/**
|
||||
* Get a random file extension.
|
||||
*
|
||||
* @param array<array<string>> $source Source array for possible extensions
|
||||
* @param array<string[]> $source Source array for possible extensions
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ final class StringUtils
|
|||
*
|
||||
* The validation is done case sensitive.
|
||||
*
|
||||
* @param string $haystack Haystack
|
||||
* @param array<string> $needles Needles to check if any of them are part of the haystack
|
||||
* @param string $haystack Haystack
|
||||
* @param string[] $needles Needles to check if any of them are part of the haystack
|
||||
*
|
||||
* @example StringUtils::contains('This string', ['This', 'test']); // true
|
||||
*
|
||||
|
|
@ -76,8 +76,8 @@ final class StringUtils
|
|||
*
|
||||
* The validation is done case sensitive.
|
||||
*
|
||||
* @param string $haystack Haystack
|
||||
* @param array<string> $needles Needles to check if any of them are part of the haystack
|
||||
* @param string $haystack Haystack
|
||||
* @param string[] $needles Needles to check if any of them are part of the haystack
|
||||
*
|
||||
* @example StringUtils::mb_contains('This string', ['This', 'test']); // true
|
||||
*
|
||||
|
|
@ -515,8 +515,8 @@ final class StringUtils
|
|||
/**
|
||||
* Create LCS diff masks
|
||||
*
|
||||
* @param array<string> $from From/old strings
|
||||
* @param array<string> $to To/new strings
|
||||
* @param string[] $from From/old strings
|
||||
* @param string[] $to To/new strings
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user