improve array docblock

This commit is contained in:
Dennis Eichhorn 2020-01-19 18:54:00 +01:00
parent caa78ed9d5
commit 59f43a6a87
33 changed files with 177 additions and 154 deletions

View File

@ -51,8 +51,8 @@ class Point implements PointInterface
/** /**
* Constructor. * Constructor.
* *
* @param array $coordinates Coordinates of the point * @param array<int, int|float> $coordinates Coordinates of the point
* @param string $name Name of the point * @param string $name Name of the point
* *
* @since 1.0.0 * @since 1.0.0
*/ */

View File

@ -141,7 +141,7 @@ class MazeGenerator
/** /**
* Render a maze * Render a maze
* *
* @param array $maze Maze to render * @param array<int, int[]> $maze Maze to render
* *
* @return string * @return string
* *

View File

@ -35,7 +35,30 @@ class Grid
/** /**
* Create a grid from an array * 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 public static function createGridFromArray(array $gridArray, string $node) : self
{ {
@ -111,7 +134,7 @@ class Grid
* @param Node $node Node to get neighbors from * @param Node $node Node to get neighbors from
* @param int $movement Allowed movements * @param int $movement Allowed movements
* *
* @return array * @return Node[]
* *
* @since 1.0.0 * @since 1.0.0
*/ */

View File

@ -29,9 +29,9 @@ final class Heuristic
/** /**
* Calculate metric/distance between two nodes. * Calculate metric/distance between two nodes.
* *
* @param array $node1 Array with 'x' and 'y' coordinate * @param array<string, int|float> $node1 Array with 'x' and 'y' coordinate
* @param array $node2 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 * @param int $heuristic Heuristic to use for calculation
* *
* @return float * @return float
* *

View File

@ -136,7 +136,7 @@ final class JumpPointSearch implements PathFinderInterface
* @param int $movement Movement type * @param int $movement Movement type
* @param Grid $grid Grid of the nodes * @param Grid $grid Grid of the nodes
* *
* @return array Neighbors of node * @return Node[] Neighbors of node
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -159,7 +159,7 @@ final class JumpPointSearch implements PathFinderInterface
* @param JumpPointNode $node Node to find successor for * @param JumpPointNode $node Node to find successor for
* @param Grid $grid Grid of the nodes * @param Grid $grid Grid of the nodes
* *
* @return array Neighbors of node * @return Node[] Neighbors of node
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -216,7 +216,7 @@ final class JumpPointSearch implements PathFinderInterface
* @param JumpPointNode $node Node to find successor for * @param JumpPointNode $node Node to find successor for
* @param Grid $grid Grid of the nodes * @param Grid $grid Grid of the nodes
* *
* @return array Neighbors of node * @return Node[] Neighbors of node
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -293,7 +293,7 @@ final class JumpPointSearch implements PathFinderInterface
* @param JumpPointNode $node Node to find successor for * @param JumpPointNode $node Node to find successor for
* @param Grid $grid Grid of the nodes * @param Grid $grid Grid of the nodes
* *
* @return array Neighbors of node * @return Node[] Neighbors of node
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -366,7 +366,7 @@ final class JumpPointSearch implements PathFinderInterface
* @param JumpPointNode $node Node to find successor for * @param JumpPointNode $node Node to find successor for
* @param Grid $grid Grid of the nodes * @param Grid $grid Grid of the nodes
* *
* @return array Neighbors of node * @return Node[] Neighbors of node
* *
* @since 1.0.0 * @since 1.0.0
*/ */

View File

@ -173,7 +173,7 @@ class Node
/** /**
* Get the coordinates of this node. * Get the coordinates of this node.
* *
* @return array ['x' => ?, 'y' => ?] * @return array<string, int> ['x' => ?, 'y' => ?]
* *
* @since 1.0.0 * @since 1.0.0
*/ */

View File

@ -128,7 +128,7 @@ final class L11nManager
* @param string $language Language iso code * @param string $language Language iso code
* @param string $module Module name * @param string $module Module name
* *
* @return array * @return array<string, string>|array<string, array<string, string>>
* *
* @since 1.0.0 * @since 1.0.0
*/ */

View File

@ -353,7 +353,7 @@ class Localization
/** /**
* get datetime format * get datetime format
* *
* @return array * @return array<string, string>
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -365,7 +365,7 @@ class Localization
/** /**
* Set datetime format * Set datetime format
* *
* @param array $datetime Datetime format * @param array<string, string> $datetime Datetime format
* *
* @return void * @return void
* *

View File

@ -104,7 +104,7 @@ class Matrix implements \ArrayAccess, \Iterator
* @param int $m Row * @param int $m Row
* @param int $n Column * @param int $n Column
* *
* @return mixed * @return int|float
* *
* @throws InvalidDimensionException * @throws InvalidDimensionException
* *
@ -176,8 +176,8 @@ class Matrix implements \ArrayAccess, \Iterator
/** /**
* Get sub matrix array. * Get sub matrix array.
* *
* @param array<int> $rows Row indices * @param int[] $rows Row indices
* @param array<int> $cols Row indices * @param int[] $cols Row indices
* *
* @return Matrix * @return Matrix
* *
@ -204,9 +204,9 @@ class Matrix implements \ArrayAccess, \Iterator
/** /**
* Get sub matrix array. * Get sub matrix array.
* *
* @param int $iRow Start row * @param int $iRow Start row
* @param int $lRow End row * @param int $lRow End row
* @param array<int> $cols Row indices * @param int[] $cols Row indices
* *
* @return Matrix * @return Matrix
* *
@ -232,9 +232,9 @@ class Matrix implements \ArrayAccess, \Iterator
/** /**
* Get sub matrix array. * Get sub matrix array.
* *
* @param array<int> $rows Row indices * @param int[] $rows Row indices
* @param int $iCol Start col * @param int $iCol Start col
* @param int $lCol End col * @param int $lCol End col
* *
* @return Matrix * @return Matrix
* *

View File

@ -44,7 +44,7 @@ final class Vector extends Matrix
* *
* @param int $m Position to get * @param int $m Position to get
* *
* @return mixed * @return int|float
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -56,7 +56,7 @@ final class Vector extends Matrix
/** /**
* Set matrix * Set matrix
* *
* @param array $vector 1-Dimensional array * @param array<int, int|float> $vector 1-Dimensional array
* *
* @return Vector * @return Vector
* *

View File

@ -146,7 +146,7 @@ final class Integer
* @param int $value Integer to factorize * @param int $value Integer to factorize
* @param int $limit Max amount of iterations * @param int $limit Max amount of iterations
* *
* @return array<int> * @return int[]
* *
* @throws \Exception This exception is thrown if the value is not odd * @throws \Exception This exception is thrown if the value is not odd
* *

View File

@ -35,7 +35,7 @@ final class LagrangeInterpolation implements InterpolationInterface
/** /**
* Constructor. * 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 * @since 1.0.0
*/ */

View File

@ -89,7 +89,7 @@ final class Evaluator
* *
* @param string $equation Equation to convert * @param string $equation Equation to convert
* *
* @return array<int, string> * @return string[]
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -147,7 +147,7 @@ final class Evaluator
$output[] = \array_pop($stack); $output[] = \array_pop($stack);
} }
/** @var array<int, string> $output */ /** @var string[] $output */
return $output; return $output;
} }
} }

View File

@ -74,7 +74,7 @@ final class Average
* @param array<int, float|int> $weight Weight for moving average * @param array<int, float|int> $weight Weight for moving average
* @param bool $symmetric Cyclic moving average * @param bool $symmetric Cyclic moving average
* *
* @return array Moving average of data * @return float[] Moving average of data
* *
* @throws \Exception * @throws \Exception
* *

View File

@ -78,9 +78,9 @@ final class Correlation
/** /**
* Box Pierce test (portmanteau test). * Box Pierce test (portmanteau test).
* *
* @param array<float> $autocorrelations Autocorrelations * @param float[] $autocorrelations Autocorrelations
* @param int $h Maximum leg considered * @param int $h Maximum leg considered
* @param int $n Amount of observations * @param int $n Amount of observations
* *
* @return float * @return float
* *
@ -99,9 +99,9 @@ final class Correlation
/** /**
* Ljung Box test (portmanteau test). * Ljung Box test (portmanteau test).
* *
* @param array<float> $autocorrelations Autocorrelations * @param float[] $autocorrelations Autocorrelations
* @param int $h Maximum leg considered * @param int $h Maximum leg considered
* @param int $n Amount of observations * @param int $n Amount of observations
* *
* @return float * @return float
* *

View File

@ -57,10 +57,10 @@ final class Error
/** /**
* Get array of errors of a forecast. * Get array of errors of a forecast.
* *
* @param array $observed Dataset * @param float[] $observed Dataset
* @param array $forecasted Forecasted * @param float[] $forecasted Forecasted
* *
* @return array * @return float[]
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -93,10 +93,10 @@ final class Error
/** /**
* Get error percentages. * Get error percentages.
* *
* @param array $errors Errors * @param float[] $errors Errors
* @param array $observed Dataset * @param float[] $observed Dataset
* *
* @return array * @return float[]
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -114,7 +114,7 @@ final class Error
/** /**
* Get mean absolute error (MAE). * Get mean absolute error (MAE).
* *
* @param array $errors Errors * @param array<int, int|float> $errors Errors
* *
* @return float * @return float
* *
@ -128,8 +128,8 @@ final class Error
/** /**
* Get mean squared error (MSE). * Get mean squared error (MSE).
* *
* @param array $errors Errors * @param array<int, int|float> $errors Errors
* @param int $offset Population/Size offset * @param int $offset Population/Size offset
* *
* @return float * @return float
* *
@ -143,7 +143,7 @@ final class Error
/** /**
* Get root mean squared error (RMSE). * Get root mean squared error (RMSE).
* *
* @param array $errors Errors * @param array<int, int|float> $errors Errors
* *
* @return float * @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} * @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 float[] $observed Obersved y values
* @param array $forecasted Forecasted y values * @param float[] $forecasted Forecasted y values
* *
* @return float * @return float
* *
@ -176,7 +176,7 @@ final class Error
/** /**
* Get sum squared error (SSE). * Get sum squared error (SSE).
* *
* @param array $errors Errors * @param array<int, int|float> $errors Errors
* *
* @return float * @return float
* *
@ -268,8 +268,8 @@ final class Error
/** /**
* Get mean absolute percentage error (MAPE). * Get mean absolute percentage error (MAPE).
* *
* @param array $observed Dataset * @param float[] $observed Dataset
* @param array $forecasted Forecasted * @param float[] $forecasted Forecasted
* *
* @return float * @return float
* *
@ -286,8 +286,8 @@ final class Error
/** /**
* Get mean absolute percentage error (sMAPE). * Get mean absolute percentage error (sMAPE).
* *
* @param array $observed Dataset * @param float[] $observed Dataset
* @param array $forecasted Forecasted * @param float[] $forecasted Forecasted
* *
* @return float * @return float
* *
@ -310,10 +310,10 @@ final class Error
/** /**
* Get cross sectional scaled errors (CSSE) * Get cross sectional scaled errors (CSSE)
* *
* @param array $errors Errors * @param array<int, int|float> $errors Errors
* @param array $observed Dataset * @param float[] $observed Dataset
* *
* @return array * @return float[]
* *
* @todo Orange-Management/phpOMS#172 * @todo Orange-Management/phpOMS#172
* Create unit test. * Create unit test.
@ -335,8 +335,8 @@ final class Error
/** /**
* Get cross sectional scaled errors (CSSE) * Get cross sectional scaled errors (CSSE)
* *
* @param float $error Errors * @param float $error Errors
* @param array $observed Dataset * @param float[] $observed Dataset
* *
* @return float * @return float
* *
@ -360,7 +360,7 @@ final class Error
/** /**
* Get mean absolute scaled error (MASE) * Get mean absolute scaled error (MASE)
* *
* @param array $scaledErrors Scaled errors * @param array<int, int|float> $scaledErrors Scaled errors
* *
* @return float * @return float
* *
@ -374,7 +374,7 @@ final class Error
/** /**
* Get mean absolute scaled error (MSSE) * Get mean absolute scaled error (MSSE)
* *
* @param array $scaledErrors Scaled errors * @param array<int, int|float> $scaledErrors Scaled errors
* *
* @return float * @return float
* *
@ -391,9 +391,9 @@ final class Error
/** /**
* Get scaled error (SE) * Get scaled error (SE)
* *
* @param array $errors Errors * @param array<int, int|float> $errors Errors
* @param array $observed Dataset * @param float[] $observed Dataset
* @param int $m Shift * @param int $m Shift
* *
* @return array * @return array
* *
@ -414,9 +414,9 @@ final class Error
/** /**
* Get scaled error (SE) * Get scaled error (SE)
* *
* @param float $error Errors * @param float $error Errors
* @param array $observed Dataset * @param float[] $observed Dataset
* @param int $m Shift * @param int $m Shift
* *
* @return float * @return float
* *
@ -430,8 +430,8 @@ final class Error
/** /**
* Get naive forecast * Get naive forecast
* *
* @param array $observed Dataset * @param float[] $observed Dataset
* @param int $m Shift * @param int $m Shift
* *
* @return float * @return float
* *

View File

@ -42,8 +42,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 $a 2-D array with x and y coordinate * @param array<string, int|float> $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> $b 2-D array with x and y coordinate
* *
* @return float * @return float
* *
@ -59,8 +59,8 @@ final class Metrics2D
* *
* @latex d(p, q) = \sqrt{\sum_{n=1}^N{(p_i - q_i)^2}} * @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<string, int|float> $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> $b 2-D array with x and y coordinate
* *
* @return float * @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} * @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<string, int|float> $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> $b 2-D array with x and y coordinate
* *
* @return float * @return float
* *
@ -99,8 +99,8 @@ final class Metrics2D
* *
* @latex d(p, q) = \max_i{(|p_i - q_i|)} * @latex d(p, q) = \max_i{(|p_i - q_i|)}
* *
* @param array $a 2-D array with x and y coordinate * @param array<string, int|float> $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> $b 2-D array with x and y coordinate
* *
* @return float * @return float
* *
@ -119,8 +119,8 @@ final class Metrics2D
* *
* @latex d(p, q) = \sqrt[\lambda]{\sum_{n=1}^N{|p_i - q_i|^\lambda}} * @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<string, int|float> $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> $b 2-D array with x and y coordinate
* @param int $lambda Lambda * @param int $lambda Lambda
* *
* @return float * @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|} * @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<string, int|float> $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> $b 2-D array with x and y coordinate
* *
* @return float * @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)}} * @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<string, int|float> $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> $b 2-D array with x and y coordinate
* *
* @return float * @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}} * @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<string, int|float> $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> $b 2-D array with x and y coordinate
* *
* @return float * @return float
* *
@ -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 $a 2-D array with x and y coordinate * @param array<string, int|float> $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> $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 $a Array with elements * @param array<string, int|float> $a Array with elements
* @param array $b Array with same elements but different order * @param array<string, int|float> $b Array with same elements but different order
* *
* @return int * @return int
* *

View File

@ -42,8 +42,8 @@ final class MetricsND
* *
* @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 $a n-D array * @param array<int|string, int|float> $a n-D array
* @param array $b n-D array * @param array<int|string, int|float> $b n-D array
* *
* @return float * @return float
* *
@ -68,8 +68,8 @@ final class MetricsND
* *
* @latex d(p, q) = \sqrt{\sum_{n=1}^N{(p_i - q_i)^2}} * @latex d(p, q) = \sqrt{\sum_{n=1}^N{(p_i - q_i)^2}}
* *
* @param array $a n-D array * @param array<int|string, int|float> $a n-D array
* @param array $b n-D array * @param array<int|string, int|float> $b n-D array
* *
* @return float * @return float
* *
@ -94,8 +94,8 @@ final class MetricsND
* *
* @latex d(p, q) = \max_i{(|p_i - q_i|)} * @latex d(p, q) = \max_i{(|p_i - q_i|)}
* *
* @param array $a n-D array * @param array<int|string, int|float> $a n-D array
* @param array $b n-D array * @param array<int|string, int|float> $b n-D array
* *
* @return float * @return float
* *
@ -120,8 +120,8 @@ final class MetricsND
* *
* @latex d(p, q) = \sqrt[\lambda]{\sum_{n=1}^N{|p_i - q_i|^\lambda}} * @latex d(p, q) = \sqrt[\lambda]{\sum_{n=1}^N{|p_i - q_i|^\lambda}}
* *
* @param array $a n-D array * @param array<int|string, int|float> $a n-D array
* @param array $b n-D array * @param array<int|string, int|float> $b n-D array
* @param int $lambda Lambda * @param int $lambda Lambda
* *
* @return float * @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|} * @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<int|string, int|float> $a n-D array
* @param array $b n-D array * @param array<int|string, int|float> $b n-D array
* *
* @return float * @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)}} * @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<int|string, int|float> $a n-D array
* @param array $b n-D array * @param array<int|string, int|float> $b n-D array
* *
* @return float * @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}} * @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<int|string, int|float> $a n-D array
* @param array $b n-D array * @param array<int|string, int|float> $b n-D array
* *
* @return float * @return float
* *
@ -231,8 +231,8 @@ final class MetricsND
* *
* @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 $a n-D array * @param array<int|string, int|float> $a n-D array
* @param array $b n-D array * @param array<int|string, int|float> $b n-D array
* *
* @return int * @return int
* *

View File

@ -146,7 +146,7 @@ abstract class ModuleAbstract
/** /**
* Get modules this module is receiving from * Get modules this module is receiving from
* *
* @return array<int, string> * @return string[]
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -159,7 +159,7 @@ abstract class ModuleAbstract
/** /**
* Get modules this module is providing for * Get modules this module is providing for
* *
* @return array<int, string> * @return string[]
* *
* @since 1.0.0 * @since 1.0.0
*/ */

View File

@ -50,7 +50,7 @@ final class ModuleManager
* *
* This is important to inform other modules what kind of information they can receive from other modules. * 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 * @since 1.0.0
*/ */
private array $providing = []; private array $providing = [];
@ -122,7 +122,7 @@ final class ModuleManager
* *
* @param RequestAbstract $request Request * @param RequestAbstract $request Request
* *
* @return array<string> * @return string[]
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -818,7 +818,7 @@ final class ModuleManager
* *
* @param Request $request Request * @param Request $request Request
* *
* @return array<string> * @return string[]
* *
* @since 1.0.0 * @since 1.0.0
*/ */

View File

@ -98,7 +98,7 @@ final class PhpCode
/** /**
* Check if function is disabled * 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 * @return bool Returns true if code has disabled function calls otherwise false is returned
* *

View File

@ -94,7 +94,7 @@ final class MultiMap implements \Countable
// prevent adding elements if keys are just ordered differently // prevent adding elements if keys are just ordered differently
if ($this->orderType === OrderType::LOOSE) { if ($this->orderType === OrderType::LOOSE) {
/** @var array<array<string>> $keysToTest */ /** @var array<string[]> $keysToTest */
$keysToTest = Permutation::permut($keys, [], false); $keysToTest = Permutation::permut($keys, [], false);
foreach ($keysToTest as $test) { foreach ($keysToTest as $test) {
@ -218,7 +218,7 @@ final class MultiMap implements \Countable
{ {
if (\is_array($key)) { if (\is_array($key)) {
if ($this->orderType === OrderType::LOOSE) { if ($this->orderType === OrderType::LOOSE) {
/** @var array<array<string>> $keys */ /** @var array<string[]> $keys */
$keys = Permutation::permut($key, [], false); $keys = Permutation::permut($key, [], false);
foreach ($keys as $key => $value) { foreach ($keys as $key => $value) {
@ -268,7 +268,7 @@ final class MultiMap implements \Countable
private function setMultiple($key, $value) : bool private function setMultiple($key, $value) : bool
{ {
if ($this->orderType !== OrderType::STRICT) { if ($this->orderType !== OrderType::STRICT) {
/** @var array<array<string>> $permutation */ /** @var array<string[]> $permutation */
$permutation = Permutation::permut($key, [], false); $permutation = Permutation::permut($key, [], false);
foreach ($permutation as $permut) { foreach ($permutation as $permut) {

View File

@ -74,7 +74,7 @@ class Directory extends FileAbstract implements FtpContainerInterface, Directory
* @param string $path Path * @param string $path Path
* @param string $filter Filter * @param string $filter Filter
* *
* @return array<int, string> * @return string[]
* *
* @since 1.0.0 * @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; return $list;
} }

View File

@ -199,10 +199,10 @@ interface FtpContainerInterface
/** /**
* Count subresources. * Count subresources.
* *
* @param resource $con FTP connection * @param resource $con FTP connection
* @param string $path Path of the resource * @param string $path Path of the resource
* @param bool $recursive Consider subdirectories * @param bool $recursive Consider subdirectories
* @param array<string> $ignore Files/paths to ignore (no regex) * @param string[] $ignore Files/paths to ignore (no regex)
* *
* @return int * @return int
* *

View File

@ -71,7 +71,7 @@ final class Directory extends FileAbstract implements LocalContainerInterface, D
* @param string $path Path * @param string $path Path
* @param string $filter Filter * @param string $filter Filter
* *
* @return array<int, string> * @return string[]
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -95,7 +95,7 @@ final class Directory extends FileAbstract implements LocalContainerInterface, D
$list[] = \str_replace('\\', '/', $iterator->getSubPathname()); $list[] = \str_replace('\\', '/', $iterator->getSubPathname());
} }
/** @var array<int, string> $list */ /** @var string[] $list */
return $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. * A file will always return 1 as it doesn't have any sub-resources.
* *
* @param string $path Path of the resource * @param string $path Path of the resource
* @param bool $recursive Should count also sub-sub-resources * @param bool $recursive Should count also sub-sub-resources
* @param array<string> $ignore Ignore files * @param string[] $ignore Ignore files
* *
* @return int * @return int
* *

View File

@ -190,9 +190,9 @@ interface LocalContainerInterface
/** /**
* Count subresources. * Count subresources.
* *
* @param string $path Path of the resource * @param string $path Path of the resource
* @param bool $recursive Consider subdirectories * @param bool $recursive Consider subdirectories
* @param array<string> $ignore Files/paths to ignore (no regex) * @param string[] $ignore Files/paths to ignore (no regex)
* *
* @return int * @return int
* *

View File

@ -243,9 +243,9 @@ abstract class StorageAbstract
/** /**
* Count subresources. * Count subresources.
* *
* @param string $path Path of the resource * @param string $path Path of the resource
* @param bool $recursive Consider subdirectories * @param bool $recursive Consider subdirectories
* @param array<string> $ignore Files/paths to ignore (no regex) * @param string[] $ignore Files/paths to ignore (no regex)
* *
* @return int * @return int
* *

View File

@ -49,7 +49,7 @@ final class Http implements UriInterface
/** /**
* Path elements. * Path elements.
* *
* @var array * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
private array $pathElements; private array $pathElements;
@ -113,7 +113,7 @@ final class Http implements UriInterface
/** /**
* Uri query. * Uri query.
* *
* @var array * @var array<string, string>
* @since 1.0.0 * @since 1.0.0
*/ */
private array $query = []; private array $query = [];

View File

@ -155,7 +155,7 @@ interface UriInterface
/** /**
* Get path elements. * Get path elements.
* *
* @return array * @return string[]
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -175,7 +175,7 @@ interface UriInterface
/** /**
* Get query array. * Get query array.
* *
* @return array * @return array<string, string>
* *
* @since 1.0.0 * @since 1.0.0
*/ */

View File

@ -260,8 +260,8 @@ final class ArrayUtils
* *
* Useful for parsing command line parsing * Useful for parsing command line parsing
* *
* @param string $id Id to find * @param string $id Id to find
* @param array<string> $args CLI command list * @param string[] $args CLI command list
* *
* @return string * @return string
* *
@ -279,8 +279,8 @@ final class ArrayUtils
/** /**
* Check if flag is set * Check if flag is set
* *
* @param string $id Id to find * @param string $id Id to find
* @param array<string> $args CLI command list * @param string[] $args CLI command list
* *
* @return int * @return int
* *
@ -389,7 +389,7 @@ final class ArrayUtils
* @param array<float|int> $values Values to square * @param array<float|int> $values Values to square
* @param float $exp Exponent * @param float $exp Exponent
* *
* @return array<float> * @return float[]
* *
* @todo Orange-Management/phpOMS#223 * @todo Orange-Management/phpOMS#223
* In the ArrayUtils class the power* functions should be combined once union types become available. * In the ArrayUtils class the power* functions should be combined once union types become available.

View File

@ -137,7 +137,7 @@ class Repository
/** /**
* Get all branches. * Get all branches.
* *
* @return array<string> * @return string[]
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -162,7 +162,7 @@ class Repository
* *
* @param string $cmd Command to run * @param string $cmd Command to run
* *
* @return array<string> * @return string[]
* *
* @throws \Exception * @throws \Exception
* *
@ -214,7 +214,7 @@ class Repository
* *
* @param string $lines Result of git command * @param string $lines Result of git command
* *
* @return array<string> * @return string[]
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -466,7 +466,7 @@ class Repository
/** /**
* Get all remote branches. * Get all remote branches.
* *
* @return array<string> * @return string[]
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -644,7 +644,7 @@ class Repository
/** /**
* Get LOC. * Get LOC.
* *
* @param array<string> $extensions Extensions whitelist * @param string[] $extensions Extensions whitelist
* *
* @return int * @return int
* *

View File

@ -47,7 +47,7 @@ class File
/** /**
* Get a random file extension. * 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 * @return string
* *

View File

@ -51,8 +51,8 @@ final class StringUtils
* *
* The validation is done case sensitive. * The validation is done case sensitive.
* *
* @param string $haystack Haystack * @param string $haystack Haystack
* @param array<string> $needles Needles to check if any of them are part of the haystack * @param string[] $needles Needles to check if any of them are part of the haystack
* *
* @example StringUtils::contains('This string', ['This', 'test']); // true * @example StringUtils::contains('This string', ['This', 'test']); // true
* *
@ -76,8 +76,8 @@ final class StringUtils
* *
* The validation is done case sensitive. * The validation is done case sensitive.
* *
* @param string $haystack Haystack * @param string $haystack Haystack
* @param array<string> $needles Needles to check if any of them are part of the 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 * @example StringUtils::mb_contains('This string', ['This', 'test']); // true
* *
@ -515,8 +515,8 @@ final class StringUtils
/** /**
* Create LCS diff masks * Create LCS diff masks
* *
* @param array<string> $from From/old strings * @param string[] $from From/old strings
* @param array<string> $to To/new strings * @param string[] $to To/new strings
* *
* @return array * @return array
* *