mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-07 21:18:39 +00:00
Improve array type hint
This commit is contained in:
parent
e611105b60
commit
ba957b4dcf
|
|
@ -65,9 +65,9 @@ final class L11nManager
|
||||||
* One module can only be loaded once. Once the module got loaded it's not
|
* One module can only be loaded once. Once the module got loaded it's not
|
||||||
* possible to load more language files later on.
|
* possible to load more language files later on.
|
||||||
*
|
*
|
||||||
* @param string $language Language iso code
|
* @param string $language Language iso code
|
||||||
* @param string $from Module name
|
* @param string $from Module name
|
||||||
* @param array $translation Language files content
|
* @param array<string, array<string, string>> $translation Language files content
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -217,9 +217,9 @@ final class FileLogger implements LoggerInterface
|
||||||
/**
|
/**
|
||||||
* Interpolate context
|
* Interpolate context
|
||||||
*
|
*
|
||||||
* @param string $message Log schema
|
* @param string $message Log schema
|
||||||
* @param array $context Context to log
|
* @param array<string, string> $context Context to log
|
||||||
* @param string $level Log level
|
* @param string $level Log level
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
|
|
@ -542,9 +542,9 @@ final class FileLogger implements LoggerInterface
|
||||||
/**
|
/**
|
||||||
* Create console log.
|
* Create console log.
|
||||||
*
|
*
|
||||||
* @param string $message Log message
|
* @param string $message Log message
|
||||||
* @param bool $verbose Is verbose
|
* @param bool $verbose Is verbose
|
||||||
* @param array $context Context
|
* @param array<string, string> $context Context
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@ interface LoggerInterface
|
||||||
/**
|
/**
|
||||||
* System is unusable.
|
* System is unusable.
|
||||||
*
|
*
|
||||||
* @param string $message Logging message schema
|
* @param string $message Logging message schema
|
||||||
* @param array $context Context to log
|
* @param array<string, string> $context Context to log
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
@ -41,8 +41,8 @@ interface LoggerInterface
|
||||||
* Example: Entire website down, database unavailable, etc. This should
|
* Example: Entire website down, database unavailable, etc. This should
|
||||||
* trigger the SMS alerts and wake you up.
|
* trigger the SMS alerts and wake you up.
|
||||||
*
|
*
|
||||||
* @param string $message Logging message schema
|
* @param string $message Logging message schema
|
||||||
* @param array $context Context to log
|
* @param array<string, string> $context Context to log
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
@ -53,8 +53,8 @@ interface LoggerInterface
|
||||||
*
|
*
|
||||||
* Example: Application component unavailable, unexpected exception.
|
* Example: Application component unavailable, unexpected exception.
|
||||||
*
|
*
|
||||||
* @param string $message Logging message schema
|
* @param string $message Logging message schema
|
||||||
* @param array $context Context to log
|
* @param array<string, string> $context Context to log
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
@ -64,8 +64,8 @@ interface LoggerInterface
|
||||||
* Runtime errors that do not require immediate action but should typically
|
* Runtime errors that do not require immediate action but should typically
|
||||||
* be logged and monitored.
|
* be logged and monitored.
|
||||||
*
|
*
|
||||||
* @param string $message Logging message schema
|
* @param string $message Logging message schema
|
||||||
* @param array $context Context to log
|
* @param array<string, string> $context Context to log
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
@ -77,8 +77,8 @@ interface LoggerInterface
|
||||||
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
||||||
* that are not necessarily wrong.
|
* that are not necessarily wrong.
|
||||||
*
|
*
|
||||||
* @param string $message Logging message schema
|
* @param string $message Logging message schema
|
||||||
* @param array $context Context to log
|
* @param array<string, string> $context Context to log
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
@ -87,8 +87,8 @@ interface LoggerInterface
|
||||||
/**
|
/**
|
||||||
* Normal but significant events.
|
* Normal but significant events.
|
||||||
*
|
*
|
||||||
* @param string $message Logging message schema
|
* @param string $message Logging message schema
|
||||||
* @param array $context Context to log
|
* @param array<string, string> $context Context to log
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
@ -99,8 +99,8 @@ interface LoggerInterface
|
||||||
*
|
*
|
||||||
* Example: User logs in, SQL logs.
|
* Example: User logs in, SQL logs.
|
||||||
*
|
*
|
||||||
* @param string $message Logging message schema
|
* @param string $message Logging message schema
|
||||||
* @param array $context Context to log
|
* @param array<string, string> $context Context to log
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
@ -109,8 +109,8 @@ interface LoggerInterface
|
||||||
/**
|
/**
|
||||||
* Detailed debug information.
|
* Detailed debug information.
|
||||||
*
|
*
|
||||||
* @param string $message Logging message schema
|
* @param string $message Logging message schema
|
||||||
* @param array $context Context to log
|
* @param array<string, string> $context Context to log
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
@ -119,9 +119,9 @@ interface LoggerInterface
|
||||||
/**
|
/**
|
||||||
* Logs with an arbitrary level.
|
* Logs with an arbitrary level.
|
||||||
*
|
*
|
||||||
* @param string $level Log level/severeness
|
* @param string $level Log level/severeness
|
||||||
* @param string $message Logging message schema
|
* @param string $message Logging message schema
|
||||||
* @param array $context Context to log
|
* @param array<string, string> $context Context to log
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,8 @@ class FiniteDifference
|
||||||
*
|
*
|
||||||
* Example: ('2*x^3-4x', ['x' => 99])
|
* Example: ('2*x^3-4x', ['x' => 99])
|
||||||
*
|
*
|
||||||
* @param string $formula Formula to differentiate
|
* @param string $formula Formula to differentiate
|
||||||
* @param array $variable Variable to differentiate (name value assiziation)
|
* @param array<string, int|float> $variable Variable to differentiate (name value assiziation)
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -56,8 +56,8 @@ class FiniteDifference
|
||||||
*
|
*
|
||||||
* Example: ('2*x^3-4x', ['x' => 99])
|
* Example: ('2*x^3-4x', ['x' => 99])
|
||||||
*
|
*
|
||||||
* @param string $formula Formula to differentiate
|
* @param string $formula Formula to differentiate
|
||||||
* @param array $variable Variable to differentiate (name value assiziation)
|
* @param array<string, int|float> $variable Variable to differentiate (name value assiziation)
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -73,9 +73,9 @@ class FiniteDifference
|
||||||
*
|
*
|
||||||
* Example: ('2*x^3-4x', ['x' => 99], 3)
|
* Example: ('2*x^3-4x', ['x' => 99], 3)
|
||||||
*
|
*
|
||||||
* @param string $formula Formula to differentiate
|
* @param string $formula Formula to differentiate
|
||||||
* @param array $variable Variable to differentiate (name value assiziation)
|
* @param array<string, int|float> $variable Variable to differentiate (name value assiziation)
|
||||||
* @param int $derivative Derivative (4th = highest)
|
* @param int $derivative Derivative (4th = highest)
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ final class MonotoneChain
|
||||||
/**
|
/**
|
||||||
* Create convex hull
|
* Create convex hull
|
||||||
*
|
*
|
||||||
* @param array $points Points (Point Cloud)
|
* @param array<string, int|float> $points Points (Point Cloud)
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
|
|
@ -83,9 +83,9 @@ final class MonotoneChain
|
||||||
/**
|
/**
|
||||||
* Counter clock wise turn?
|
* Counter clock wise turn?
|
||||||
*
|
*
|
||||||
* @param array $a Point a
|
* @param array<string, int|float> $a Point a
|
||||||
* @param array $b Point b
|
* @param array<string, int|float> $b Point b
|
||||||
* @param array $c Point c
|
* @param array<string, int|float> $c Point c
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -99,8 +99,8 @@ final class MonotoneChain
|
||||||
/**
|
/**
|
||||||
* Sort by x coordinate then by z coordinate
|
* Sort by x coordinate then by z coordinate
|
||||||
*
|
*
|
||||||
* @param array $a Point a
|
* @param array<string, int|float> $a Point a
|
||||||
* @param array $b Point b
|
* @param array<string, int|float> $b Point b
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,8 @@ final class Average
|
||||||
/**
|
/**
|
||||||
* Average change.
|
* Average change.
|
||||||
*
|
*
|
||||||
* @param array $x Dataset
|
* @param array<int, float|int> $x Dataset
|
||||||
* @param int $h Future steps
|
* @param int $h Future steps
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -71,10 +71,10 @@ final class Average
|
||||||
/**
|
/**
|
||||||
* Moving average of dataset
|
* Moving average of dataset
|
||||||
*
|
*
|
||||||
* @param array $x Dataset
|
* @param array<int, float|int> $x Dataset
|
||||||
* @param int $order Periods to use for average
|
* @param int $order Periods to use for average
|
||||||
* @param array $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 array Moving average of data
|
||||||
*
|
*
|
||||||
|
|
@ -98,11 +98,11 @@ final class Average
|
||||||
/**
|
/**
|
||||||
* Moving average of element in dataset
|
* Moving average of element in dataset
|
||||||
*
|
*
|
||||||
* @param array $x Dataset
|
* @param array<int, float|int> $x Dataset
|
||||||
* @param int $t Current period
|
* @param int $t Current period
|
||||||
* @param int $order Periods to use for average
|
* @param int $order Periods to use for average
|
||||||
* @param array $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 float Moving average
|
* @return float Moving average
|
||||||
*
|
*
|
||||||
|
|
@ -135,8 +135,8 @@ final class Average
|
||||||
*
|
*
|
||||||
* Example: ([1, 2, 3, 4], [0.25, 0.5, 0.125, 0.125])
|
* Example: ([1, 2, 3, 4], [0.25, 0.5, 0.125, 0.125])
|
||||||
*
|
*
|
||||||
* @param array $values Values
|
* @param array<int, float|int> $values Values
|
||||||
* @param array $weight Weight for values
|
* @param array<int, float|int> $weight Weight for values
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -164,7 +164,7 @@ final class Average
|
||||||
*
|
*
|
||||||
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
||||||
*
|
*
|
||||||
* @param array $values Values
|
* @param array<int, float|int> $values Values
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -188,7 +188,7 @@ final class Average
|
||||||
*
|
*
|
||||||
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
||||||
*
|
*
|
||||||
* @param array $values Values
|
* @param array<int, float|int> $values Values
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -207,7 +207,7 @@ final class Average
|
||||||
*
|
*
|
||||||
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
||||||
*
|
*
|
||||||
* @param array $values Values
|
* @param array<int, float|int> $values Values
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -235,8 +235,8 @@ final class Average
|
||||||
*
|
*
|
||||||
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
||||||
*
|
*
|
||||||
* @param array $values Values
|
* @param array<int, float|int> $values Values
|
||||||
* @param int $offset Offset for outlier
|
* @param int $offset Offset for outlier
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -260,8 +260,8 @@ final class Average
|
||||||
*
|
*
|
||||||
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
||||||
*
|
*
|
||||||
* @param array $values Values
|
* @param array<int, float|int> $values Values
|
||||||
* @param int $offset Offset for outlier
|
* @param int $offset Offset for outlier
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -296,8 +296,8 @@ final class Average
|
||||||
*
|
*
|
||||||
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
||||||
*
|
*
|
||||||
* @param array $angles Angles
|
* @param array<int, float|int> $angles Angles
|
||||||
* @param int $offset Offset for outlier
|
* @param int $offset Offset for outlier
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -325,8 +325,8 @@ final class Average
|
||||||
*
|
*
|
||||||
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
* Example: ([1, 2, 2, 3, 4, 4, 2])
|
||||||
*
|
*
|
||||||
* @param array $angles Angles
|
* @param array<int, float|int> $angles Angles
|
||||||
* @param int $offset Offset for outlier
|
* @param int $offset Offset for outlier
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ final class MeasureOfDispersion
|
||||||
*
|
*
|
||||||
* Example: ([4, 5, 9, 1, 3])
|
* Example: ([4, 5, 9, 1, 3])
|
||||||
*
|
*
|
||||||
* @param array $values Values
|
* @param array<int, float|int> $values Values
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -63,8 +63,8 @@ final class MeasureOfDispersion
|
||||||
*
|
*
|
||||||
* Example: ([4, 5, 9, 1, 3])
|
* Example: ([4, 5, 9, 1, 3])
|
||||||
*
|
*
|
||||||
* @param array $values Values
|
* @param array<int, float|int> $values Values
|
||||||
* @param float $mean Mean
|
* @param float $mean Mean
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -90,8 +90,8 @@ final class MeasureOfDispersion
|
||||||
*
|
*
|
||||||
* @latex \sigma = \sqrt{\sigma^{2}} = \sqrt{Var(X)}
|
* @latex \sigma = \sqrt{\sigma^{2}} = \sqrt{Var(X)}
|
||||||
*
|
*
|
||||||
* @param array $values Values
|
* @param array<int, float|int> $values Values
|
||||||
* @param float $mean Mean
|
* @param float $mean Mean
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -118,8 +118,8 @@ final class MeasureOfDispersion
|
||||||
*
|
*
|
||||||
* @latex \sigma^{2} = Var(X) = \frac{1}{N - 1} \sum_{i = 1}^{N}\left(x_{i} - \bar{X}\right)^{2}
|
* @latex \sigma^{2} = Var(X) = \frac{1}{N - 1} \sum_{i = 1}^{N}\left(x_{i} - \bar{X}\right)^{2}
|
||||||
*
|
*
|
||||||
* @param array $values Values
|
* @param array<int, float|int> $values Values
|
||||||
* @param float $mean Mean
|
* @param float $mean Mean
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -147,9 +147,9 @@ final class MeasureOfDispersion
|
||||||
*
|
*
|
||||||
* @latex \sigma^{2} = Var(X) = \frac{1}{N} \sum_{i = 1}^{N}\left(x_{i} - \bar{X}\right)^{2}
|
* @latex \sigma^{2} = Var(X) = \frac{1}{N} \sum_{i = 1}^{N}\left(x_{i} - \bar{X}\right)^{2}
|
||||||
*
|
*
|
||||||
* @param array $values Values
|
* @param array<int, float|int> $values Values
|
||||||
* @param array $probabilities Probabilities
|
* @param array<int, float|int> $probabilities Probabilities
|
||||||
* @param float $mean Mean
|
* @param float $mean Mean
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -183,10 +183,10 @@ final class MeasureOfDispersion
|
||||||
*
|
*
|
||||||
* @latex \sigma_{XY} = cov(X, Y) = \sum_{i = 1}^{N}\frac{\left(x_{i} - \bar{X}\right) \left(y_{i} - \bar{Y}\right)}{N - 1}
|
* @latex \sigma_{XY} = cov(X, Y) = \sum_{i = 1}^{N}\frac{\left(x_{i} - \bar{X}\right) \left(y_{i} - \bar{Y}\right)}{N - 1}
|
||||||
*
|
*
|
||||||
* @param array $x Values
|
* @param array<int, float|int> $x Values
|
||||||
* @param array $y Values
|
* @param array<int, float|int> $y Values
|
||||||
* @param float $meanX Mean
|
* @param float $meanX Mean
|
||||||
* @param float $meanY Mean
|
* @param float $meanY Mean
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -221,7 +221,7 @@ final class MeasureOfDispersion
|
||||||
/**
|
/**
|
||||||
* Get interquartile range.
|
* Get interquartile range.
|
||||||
*
|
*
|
||||||
* @param array $x Dataset
|
* @param array<int, float|int> $x Dataset
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -235,8 +235,8 @@ final class MeasureOfDispersion
|
||||||
/**
|
/**
|
||||||
* Get mean deviation.
|
* Get mean deviation.
|
||||||
*
|
*
|
||||||
* @param array $x Values
|
* @param array<int, float|int> $x Values
|
||||||
* @param float $mean Mean
|
* @param float $mean Mean
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -257,8 +257,8 @@ final class MeasureOfDispersion
|
||||||
/**
|
/**
|
||||||
* Get mean absolute deviation.
|
* Get mean absolute deviation.
|
||||||
*
|
*
|
||||||
* @param array $x Values
|
* @param array<int, float|int> $x Values
|
||||||
* @param float $mean Mean
|
* @param float $mean Mean
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
@ -279,8 +279,8 @@ final class MeasureOfDispersion
|
||||||
/**
|
/**
|
||||||
* Get squared mean deviation.
|
* Get squared mean deviation.
|
||||||
*
|
*
|
||||||
* @param array $x Values
|
* @param array<int, float|int> $x Values
|
||||||
* @param float $mean Mean
|
* @param float $mean Mean
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user