@@ -23,7 +23,7 @@ class ChiSquared
2323 * @param mixed $degrees Integer degrees of freedom
2424 * Or can be an array of values
2525 *
26- * @return array|float|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
26+ * @return array<mixed> |float|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
2727 * with the same dimensions
2828 */
2929 public static function distributionRightTail (mixed $ value , mixed $ degrees ): array |string |int |float
@@ -65,7 +65,7 @@ public static function distributionRightTail(mixed $value, mixed $degrees): arra
6565 * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false)
6666 * Or can be an array of values
6767 *
68- * @return array|float|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
68+ * @return array<mixed> |float|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
6969 * with the same dimensions
7070 */
7171 public static function distributionLeftTail (mixed $ value , mixed $ degrees , mixed $ cumulative ): array |string |int |float
@@ -113,7 +113,7 @@ public static function distributionLeftTail(mixed $value, mixed $degrees, mixed
113113 * @param mixed $degrees Integer degrees of freedom
114114 * Or can be an array of values
115115 *
116- * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
116+ * @return array<mixed> |float|string If an array of numbers is passed as an argument, then the returned result will also be an array
117117 * with the same dimensions
118118 */
119119 public static function inverseRightTail (mixed $ probability , mixed $ degrees )
@@ -133,7 +133,7 @@ public static function inverseRightTail(mixed $probability, mixed $degrees)
133133 return ExcelError::NAN ();
134134 }
135135
136- $ callback = fn ($ value ): float => 1 - (Gamma::incompleteGamma ($ degrees / 2 , $ value / 2 )
136+ $ callback = fn (float $ value ): float => 1 - (Gamma::incompleteGamma ($ degrees / 2 , $ value / 2 )
137137 / Gamma::gammaValue ($ degrees / 2 ));
138138
139139 $ newtonRaphson = new NewtonRaphson ($ callback );
@@ -151,7 +151,7 @@ public static function inverseRightTail(mixed $probability, mixed $degrees)
151151 * @param mixed $degrees Integer degrees of freedom
152152 * Or can be an array of values
153153 *
154- * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
154+ * @return array<mixed> |float|string If an array of numbers is passed as an argument, then the returned result will also be an array
155155 * with the same dimensions
156156 */
157157 public static function inverseLeftTail (mixed $ probability , mixed $ degrees ): array |string |float
@@ -181,13 +181,15 @@ public static function inverseLeftTail(mixed $probability, mixed $degrees): arra
181181 * (of observed and expected frequencies), are likely to be simply due to sampling error,
182182 * or if they are likely to be real.
183183 *
184- * @param array $actual an array of observed frequencies
185- * @param array $expected an array of expected frequencies
184+ * @param float[] $actual an array of observed frequencies
185+ * @param float[] $expected an array of expected frequencies
186186 */
187187 public static function test ($ actual , $ expected ): float |string
188188 {
189189 $ rows = count ($ actual );
190+ /** @var float[] */
190191 $ actual = Functions::flattenArray ($ actual );
192+ /** @var float[] */
191193 $ expected = Functions::flattenArray ($ expected );
192194 $ columns = intdiv (count ($ actual ), $ rows );
193195
0 commit comments