@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * |
16 | 16 | * @return float|int Random number |
17 | 17 | */ |
18 | - public static function rand(): int|float |
|
18 | + public static function rand(): int | float |
|
19 | 19 | { |
20 | 20 | return mt_rand(0, 10000000) / 10000000; |
21 | 21 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * If an array of numbers is passed as an argument, then the returned result will also be an array |
33 | 33 | * with the same dimensions |
34 | 34 | */ |
35 | - public static function randBetween(mixed $min, mixed $max): array|string|int |
|
35 | + public static function randBetween(mixed $min, mixed $max): array | string | int |
|
36 | 36 | { |
37 | 37 | if (is_array($min) || is_array($max)) { |
38 | 38 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $min, $max); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @return array<mixed>|string The resulting array, or a string containing an error |
69 | 69 | */ |
70 | - public static function randArray(mixed $rows = 1, mixed $columns = 1, mixed $min = 0, mixed $max = 1, bool $wholeNumber = false): string|array |
|
70 | + public static function randArray(mixed $rows = 1, mixed $columns = 1, mixed $min = 0, mixed $max = 1, bool $wholeNumber = false): string | array |
|
71 | 71 | { |
72 | 72 | try { |
73 | 73 | $rows = (int) Helpers::validateNumericNullSubstitution($rows, 1); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | return array_chunk( |
88 | 88 | array_map( |
89 | - fn (): int|float => $wholeNumber |
|
89 | + fn (): int | float => $wholeNumber |
|
90 | 90 | ? mt_rand((int) $min, (int) $max) |
91 | 91 | : (mt_rand() / mt_getrandmax()) * ($max - $min) + $min, |
92 | 92 | array_fill(0, $rows * $columns, $min) |
@@ -22,7 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @return array<mixed>|float|int|string The result, or a string containing an error |
24 | 24 | */ |
25 | - public static function evaluate(mixed $x, mixed $n, mixed $m, ...$args): array|string|float|int |
|
25 | + public static function evaluate(mixed $x, mixed $n, mixed $m, ...$args): array | string | float | int |
|
26 | 26 | { |
27 | 27 | if (is_array($x) || is_array($n) || is_array($m)) { |
28 | 28 | return self::evaluateArrayArgumentsSubset([self::class, __FUNCTION__], 3, $x, $n, $m, ...$args); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * |
19 | 19 | * @param mixed ...$args Data values |
20 | 20 | */ |
21 | - public static function sumSquare(mixed ...$args): string|int|float |
|
21 | + public static function sumSquare(mixed ...$args): string | int | float |
|
22 | 22 | { |
23 | 23 | try { |
24 | 24 | $returnValue = 0; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @param mixed[] $matrixData1 Matrix #1 |
64 | 64 | * @param mixed[] $matrixData2 Matrix #2 |
65 | 65 | */ |
66 | - public static function sumXSquaredMinusYSquared(array $matrixData1, array $matrixData2): string|int|float |
|
66 | + public static function sumXSquaredMinusYSquared(array $matrixData1, array $matrixData2): string | int | float |
|
67 | 67 | { |
68 | 68 | try { |
69 | 69 | /** @var array<float|int> */ |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @param mixed[] $matrixData1 Matrix #1 |
92 | 92 | * @param mixed[] $matrixData2 Matrix #2 |
93 | 93 | */ |
94 | - public static function sumXSquaredPlusYSquared(array $matrixData1, array $matrixData2): string|int|float |
|
94 | + public static function sumXSquaredPlusYSquared(array $matrixData1, array $matrixData2): string | int | float |
|
95 | 95 | { |
96 | 96 | try { |
97 | 97 | /** @var array<float|int> */ |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * @param mixed[] $matrixData1 Matrix #1 |
120 | 120 | * @param mixed[] $matrixData2 Matrix #2 |
121 | 121 | */ |
122 | - public static function sumXMinusYSquared(array $matrixData1, array $matrixData2): string|int|float |
|
122 | + public static function sumXMinusYSquared(array $matrixData1, array $matrixData2): string | int | float |
|
123 | 123 | { |
124 | 124 | try { |
125 | 125 | /** @var array<float|int> */ |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * If an array of numbers is passed as an argument, then the returned result will also be an array |
24 | 24 | * with the same dimensions |
25 | 25 | */ |
26 | - public static function mod(mixed $dividend, mixed $divisor): array|string|float |
|
26 | + public static function mod(mixed $dividend, mixed $divisor): array | string | float |
|
27 | 27 | { |
28 | 28 | if (is_array($dividend) || is_array($divisor)) { |
29 | 29 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $dividend, $divisor); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * If an array of numbers is passed as an argument, then the returned result will also be an array |
60 | 60 | * with the same dimensions |
61 | 61 | */ |
62 | - public static function power(null|array|bool|float|int|string $x, null|array|bool|float|int|string $y): array|float|int|string |
|
62 | + public static function power(null | array | bool | float | int | string $x, null | array | bool | float | int | string $y): array | float | int | string |
|
63 | 63 | { |
64 | 64 | if (is_array($x) || is_array($y)) { |
65 | 65 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $x, $y); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @param mixed ...$args Data values |
98 | 98 | */ |
99 | - public static function product(mixed ...$args): string|float |
|
99 | + public static function product(mixed ...$args): string | float |
|
100 | 100 | { |
101 | 101 | $args = array_filter( |
102 | 102 | Functions::flattenArray($args), |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * @return array<mixed>|int|string If an array of numbers is passed as an argument, then the returned result will also be an array |
137 | 137 | * with the same dimensions |
138 | 138 | */ |
139 | - public static function quotient(mixed $numerator, mixed $denominator): array|string|int |
|
139 | + public static function quotient(mixed $numerator, mixed $denominator): array | string | int |
|
140 | 140 | { |
141 | 141 | if (is_array($numerator) || is_array($denominator)) { |
142 | 142 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $numerator, $denominator); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * |
19 | 19 | * @param mixed ...$args Data values |
20 | 20 | */ |
21 | - public static function sumIgnoringStrings(mixed ...$args): float|int|string |
|
21 | + public static function sumIgnoringStrings(mixed ...$args): float | int | string |
|
22 | 22 | { |
23 | 23 | $returnValue = 0; |
24 | 24 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @return array<mixed>|float|int|string |
50 | 50 | */ |
51 | - public static function sumErroringStrings(mixed ...$args): float|int|string|array |
|
51 | + public static function sumErroringStrings(mixed ...$args): float | int | string | array |
|
52 | 52 | { |
53 | 53 | $returnValue = 0; |
54 | 54 | // Loop through the arguments |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * |
82 | 82 | * @return float|int|string The result, or a string containing an error |
83 | 83 | */ |
84 | - public static function product(mixed ...$args): string|int|float |
|
84 | + public static function product(mixed ...$args): string | int | float |
|
85 | 85 | { |
86 | 86 | $arrayList = $args; |
87 | 87 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @return array<mixed>|string The resulting array, or a string containing an error |
59 | 59 | */ |
60 | - public static function sequence(mixed $rows = 1, mixed $columns = 1, mixed $start = 1, mixed $step = 1): string|array |
|
60 | + public static function sequence(mixed $rows = 1, mixed $columns = 1, mixed $start = 1, mixed $step = 1): string | array |
|
61 | 61 | { |
62 | 62 | try { |
63 | 63 | $rows = (int) Helpers::validateNumericNullSubstitution($rows, 1); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * |
121 | 121 | * @return array<mixed>|string The result, or a string containing an error |
122 | 122 | */ |
123 | - public static function inverse(mixed $matrixValues): array|string |
|
123 | + public static function inverse(mixed $matrixValues): array | string |
|
124 | 124 | { |
125 | 125 | try { |
126 | 126 | $matrix = self::getMatrix($matrixValues); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * |
144 | 144 | * @return array<mixed>|string The result, or a string containing an error |
145 | 145 | */ |
146 | - public static function multiply(mixed $matrixData1, mixed $matrixData2): array|string |
|
146 | + public static function multiply(mixed $matrixData1, mixed $matrixData2): array | string |
|
147 | 147 | { |
148 | 148 | try { |
149 | 149 | $matrixA = self::getMatrix($matrixData1); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @return array<mixed>|int|string If an array of values is passed for the argument, then the returned result |
24 | 24 | * will also be an array with matching dimensions |
25 | 25 | */ |
26 | - public static function length(mixed $value = ''): array|int|string |
|
26 | + public static function length(mixed $value = ''): array | int | string |
|
27 | 27 | { |
28 | 28 | if (is_array($value)) { |
29 | 29 | return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @return array<mixed>|bool|string If an array of values is passed for either of the arguments, then the returned result |
52 | 52 | * will also be an array with matching dimensions |
53 | 53 | */ |
54 | - public static function exact(mixed $value1, mixed $value2): array|bool|string |
|
54 | + public static function exact(mixed $value1, mixed $value2): array | bool | string |
|
55 | 55 | { |
56 | 56 | if (is_array($value1) || is_array($value2)) { |
57 | 57 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $value1, $value2); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @return array<mixed>|string If an array of values is passed for the argument, then the returned result |
77 | 77 | * will also be an array with matching dimensions |
78 | 78 | */ |
79 | - public static function test(mixed $testValue = ''): array|string |
|
79 | + public static function test(mixed $testValue = ''): array | string |
|
80 | 80 | { |
81 | 81 | if (is_array($testValue)) { |
82 | 82 | return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $testValue); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * |
111 | 111 | * @return array<mixed>|string the array built from the text, split by the row and column delimiters, or an error string |
112 | 112 | */ |
113 | - public static function split(mixed $text, $columnDelimiter = null, $rowDelimiter = null, bool $ignoreEmpty = false, bool $matchMode = true, mixed $padding = '#N/A'): array|string |
|
113 | + public static function split(mixed $text, $columnDelimiter = null, $rowDelimiter = null, bool $ignoreEmpty = false, bool $matchMode = true, mixed $padding = '#N/A'): array | string |
|
114 | 114 | { |
115 | 115 | $text = Functions::flattenSingleValue($text); |
116 | 116 | if (ErrorValue::isError($text, true)) { |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | if (is_array($delimiter) && count($valueSet) > 1) { |
195 | 195 | /** @var array<?string> $valueSet */ |
196 | 196 | $quotedDelimiters = array_map( |
197 | - fn (?string $delimiter): string => preg_quote($delimiter ?? '', '/'), |
|
197 | + fn (?string $delimiter) : string => preg_quote($delimiter ?? '', '/'), |
|
198 | 198 | $valueSet |
199 | 199 | ); |
200 | 200 | $delimiters = implode('|', $quotedDelimiters); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * If an array of values is passed for the $value or $chars arguments, then the returned result |
25 | 25 | * will also be an array with matching dimensions |
26 | 26 | */ |
27 | - public static function left(mixed $value, mixed $chars = 1): array|string |
|
27 | + public static function left(mixed $value, mixed $chars = 1): array | string |
|
28 | 28 | { |
29 | 29 | if (is_array($value) || is_array($chars)) { |
30 | 30 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $chars); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * If an array of values is passed for the $value, $start or $chars arguments, then the returned result |
55 | 55 | * will also be an array with matching dimensions |
56 | 56 | */ |
57 | - public static function mid(mixed $value, mixed $start, mixed $chars): array|string |
|
57 | + public static function mid(mixed $value, mixed $start, mixed $chars): array | string |
|
58 | 58 | { |
59 | 59 | if (is_array($value) || is_array($start) || is_array($chars)) { |
60 | 60 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $start, $chars); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * If an array of values is passed for the $value or $chars arguments, then the returned result |
84 | 84 | * will also be an array with matching dimensions |
85 | 85 | */ |
86 | - public static function right(mixed $value, mixed $chars = 1): array|string |
|
86 | + public static function right(mixed $value, mixed $chars = 1): array | string |
|
87 | 87 | { |
88 | 88 | if (is_array($value) || is_array($chars)) { |
89 | 89 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $chars); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * If an array of values is passed for any of the arguments, then the returned result |
127 | 127 | * will also be an array with matching dimensions |
128 | 128 | */ |
129 | - public static function before(mixed $text, $delimiter, mixed $instance = 1, mixed $matchMode = 0, mixed $matchEnd = 0, mixed $ifNotFound = '#N/A'): array|string |
|
129 | + public static function before(mixed $text, $delimiter, mixed $instance = 1, mixed $matchMode = 0, mixed $matchEnd = 0, mixed $ifNotFound = '#N/A'): array | string |
|
130 | 130 | { |
131 | 131 | if (is_array($text) || is_array($instance) || is_array($matchMode) || is_array($matchEnd) || is_array($ifNotFound)) { |
132 | 132 | return self::evaluateArrayArgumentsIgnore([self::class, __FUNCTION__], 1, $text, $delimiter, $instance, $matchMode, $matchEnd, $ifNotFound); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * If an array of values is passed for any of the arguments, then the returned result |
191 | 191 | * will also be an array with matching dimensions |
192 | 192 | */ |
193 | - public static function after(mixed $text, $delimiter, mixed $instance = 1, mixed $matchMode = 0, mixed $matchEnd = 0, mixed $ifNotFound = '#N/A'): array|string |
|
193 | + public static function after(mixed $text, $delimiter, mixed $instance = 1, mixed $matchMode = 0, mixed $matchEnd = 0, mixed $ifNotFound = '#N/A'): array | string |
|
194 | 194 | { |
195 | 195 | if (is_array($text) || is_array($instance) || is_array($matchMode) || is_array($matchEnd) || is_array($ifNotFound)) { |
196 | 196 | return self::evaluateArrayArgumentsIgnore([self::class, __FUNCTION__], 1, $text, $delimiter, $instance, $matchMode, $matchEnd, $ifNotFound); |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | * |
235 | 235 | * @return array<string>|string |
236 | 236 | */ |
237 | - private static function validateTextBeforeAfter(string $text, null|array|string $delimiter, int $instance, int $matchMode, int $matchEnd, mixed $ifNotFound): array|string |
|
237 | + private static function validateTextBeforeAfter(string $text, null | array | string $delimiter, int $instance, int $matchMode, int $matchEnd, mixed $ifNotFound): array | string |
|
238 | 238 | { |
239 | 239 | $flags = self::matchFlags($matchMode); |
240 | 240 | $delimiter = self::buildDelimiter($delimiter); |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | /** @var array<?string> */ |
272 | 272 | $delimiter = Functions::flattenArray($delimiter); |
273 | 273 | $quotedDelimiters = array_map( |
274 | - fn (?string $delimiter): string => preg_quote($delimiter ?? '', '/'), |
|
274 | + fn (?string $delimiter) : string => preg_quote($delimiter ?? '', '/'), |
|
275 | 275 | $delimiter |
276 | 276 | ); |
277 | 277 | $delimiters = implode('|', $quotedDelimiters); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * |
18 | 18 | * @return int[] |
19 | 19 | */ |
20 | - private static function splitNumber(float|int $number): array |
|
20 | + private static function splitNumber(float | int $number): array |
|
21 | 21 | { |
22 | 22 | return [(int) floor($number / self::SPLIT_DIVISOR), (int) fmod($number, self::SPLIT_DIVISOR)]; |
23 | 23 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @return array<mixed>|int|string If an array of numbers is passed as an argument, then the returned result will also be an array |
37 | 37 | * with the same dimensions |
38 | 38 | */ |
39 | - public static function BITAND(null|array|bool|float|int|string $number1, null|array|bool|float|int|string $number2): array|string|int|float |
|
39 | + public static function BITAND(null | array | bool | float | int | string $number1, null | array | bool | float | int | string $number2): array | string | int | float |
|
40 | 40 | { |
41 | 41 | if (is_array($number1) || is_array($number2)) { |
42 | 42 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $number1, $number2); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @return array<mixed>|int|string If an array of numbers is passed as an argument, then the returned result will also be an array |
69 | 69 | * with the same dimensions |
70 | 70 | */ |
71 | - public static function BITOR(null|array|bool|float|int|string $number1, null|array|bool|float|int|string $number2): array|string|int|float |
|
71 | + public static function BITOR(null | array | bool | float | int | string $number1, null | array | bool | float | int | string $number2): array | string | int | float |
|
72 | 72 | { |
73 | 73 | if (is_array($number1) || is_array($number2)) { |
74 | 74 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $number1, $number2); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @return array<mixed>|int|string If an array of numbers is passed as an argument, then the returned result will also be an array |
102 | 102 | * with the same dimensions |
103 | 103 | */ |
104 | - public static function BITXOR(null|array|bool|float|int|string $number1, null|array|bool|float|int|string $number2): array|string|int|float |
|
104 | + public static function BITXOR(null | array | bool | float | int | string $number1, null | array | bool | float | int | string $number2): array | string | int | float |
|
105 | 105 | { |
106 | 106 | if (is_array($number1) || is_array($number2)) { |
107 | 107 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $number1, $number2); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @return array<mixed>|float|string If an array of numbers is passed as an argument, then the returned result will also be an array |
135 | 135 | * with the same dimensions |
136 | 136 | */ |
137 | - public static function BITLSHIFT(null|array|bool|float|int|string $number, null|array|bool|float|int|string $shiftAmount): array|string|float |
|
137 | + public static function BITLSHIFT(null | array | bool | float | int | string $number, null | array | bool | float | int | string $shiftAmount): array | string | float |
|
138 | 138 | { |
139 | 139 | if (is_array($number) || is_array($shiftAmount)) { |
140 | 140 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $shiftAmount); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * @return array<mixed>|float|string If an array of numbers is passed as an argument, then the returned result will also be an array |
170 | 170 | * with the same dimensions |
171 | 171 | */ |
172 | - public static function BITRSHIFT(null|array|bool|float|int|string $number, null|array|bool|float|int|string $shiftAmount): array|string|float |
|
172 | + public static function BITRSHIFT(null | array | bool | float | int | string $number, null | array | bool | float | int | string $shiftAmount): array | string | float |
|
173 | 173 | { |
174 | 174 | if (is_array($number) || is_array($shiftAmount)) { |
175 | 175 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $shiftAmount); |