@@ -189,7 +189,7 @@ |
||
189 | 189 | return str_replace('""""', '""', $operator . $operand); |
190 | 190 | } |
191 | 191 | |
192 | - private static function operandSpecialHandling(mixed $operand): bool|float|int|string |
|
192 | + private static function operandSpecialHandling(mixed $operand): bool | float | int | string |
|
193 | 193 | { |
194 | 194 | if (is_numeric($operand) || is_bool($operand)) { |
195 | 195 | return $operand; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @param array $args data to be concatenated |
51 | 51 | */ |
52 | - public static function actualCONCATENATE(...$args): array|string |
|
52 | + public static function actualCONCATENATE(...$args): array | string |
|
53 | 53 | { |
54 | 54 | if (Functions::getCompatibilityMode() === Functions::COMPATIBILITY_GNUMERIC) { |
55 | 55 | return self::CONCATENATE(...$args); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | return $result; |
66 | 66 | } |
67 | 67 | |
68 | - private static function concatenate2Args(array|string $operand1, null|array|bool|float|int|string $operand2): array|string |
|
68 | + private static function concatenate2Args(array | string $operand1, null | array | bool | float | int | string $operand2): array | string |
|
69 | 69 | { |
70 | 70 | if (is_array($operand1) || is_array($operand2)) { |
71 | 71 | $operand1 = Calculation::boolToString($operand1); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * If an array of values is passed for the $delimiter or $ignoreEmpty arguments, then the returned result |
114 | 114 | * will also be an array with matching dimensions |
115 | 115 | */ |
116 | - public static function TEXTJOIN($delimiter = '', $ignoreEmpty = true, mixed ...$args): array|string |
|
116 | + public static function TEXTJOIN($delimiter = '', $ignoreEmpty = true, mixed ...$args): array | string |
|
117 | 117 | { |
118 | 118 | if (is_array($delimiter) || is_array($ignoreEmpty)) { |
119 | 119 | return self::evaluateArrayArgumentsSubset( |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * If an array of values is passed for the $stringValue or $repeatCount arguments, then the returned result |
172 | 172 | * will also be an array with matching dimensions |
173 | 173 | */ |
174 | - public static function builtinREPT(mixed $stringValue, mixed $repeatCount): array|string |
|
174 | + public static function builtinREPT(mixed $stringValue, mixed $repeatCount): array | string |
|
175 | 175 | { |
176 | 176 | if (is_array($stringValue) || is_array($repeatCount)) { |
177 | 177 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $stringValue, $repeatCount); |
@@ -84,7 +84,7 @@ |
||
84 | 84 | * in hidden rows |
85 | 85 | * @param mixed[] $args A mixed data series of values |
86 | 86 | */ |
87 | - public static function evaluate(mixed $functionType, ...$args): float|int|string |
|
87 | + public static function evaluate(mixed $functionType, ...$args): float | int | string |
|
88 | 88 | { |
89 | 89 | /** @var Cell */ |
90 | 90 | $cellReference = array_pop($args); |
@@ -42,7 +42,7 @@ |
||
42 | 42 | * |
43 | 43 | * @return array|string An array containing a cell or range of cells, or a string on error |
44 | 44 | */ |
45 | - public static function OFFSET(?string $cellAddress = null, $rows = 0, $columns = 0, $height = null, $width = null, ?Cell $cell = null): string|array |
|
45 | + public static function OFFSET(?string $cellAddress = null, $rows = 0, $columns = 0, $height = null, $width = null, ?Cell $cell = null): string | array |
|
46 | 46 | { |
47 | 47 | /** @var int */ |
48 | 48 | $rows = Functions::flattenSingleValue($rows); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 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 |
27 | 27 | * with the same dimensions |
28 | 28 | */ |
29 | - public static function distributionRightTail(mixed $value, mixed $degrees): array|string|int|float |
|
29 | + public static function distributionRightTail(mixed $value, mixed $degrees): array | string | int | float |
|
30 | 30 | { |
31 | 31 | if (is_array($value) || is_array($degrees)) { |
32 | 32 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $degrees); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 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 |
69 | 69 | * with the same dimensions |
70 | 70 | */ |
71 | - public static function distributionLeftTail(mixed $value, mixed $degrees, mixed $cumulative): array|string|int|float |
|
71 | + public static function distributionLeftTail(mixed $value, mixed $degrees, mixed $cumulative): array | string | int | float |
|
72 | 72 | { |
73 | 73 | if (is_array($value) || is_array($degrees) || is_array($cumulative)) { |
74 | 74 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $degrees, $cumulative); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array |
155 | 155 | * with the same dimensions |
156 | 156 | */ |
157 | - public static function inverseLeftTail(mixed $probability, mixed $degrees): array|string|float |
|
157 | + public static function inverseLeftTail(mixed $probability, mixed $degrees): array | string | float |
|
158 | 158 | { |
159 | 159 | if (is_array($probability) || is_array($degrees)) { |
160 | 160 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $degrees); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * @param array $actual an array of observed frequencies |
185 | 185 | * @param array $expected an array of expected frequencies |
186 | 186 | */ |
187 | - public static function test($actual, $expected): float|string |
|
187 | + public static function test($actual, $expected): float | string |
|
188 | 188 | { |
189 | 189 | $rows = count($actual); |
190 | 190 | $actual = Functions::flattenArray($actual); |
@@ -337,10 +337,10 @@ discard block |
||
337 | 337 | } |
338 | 338 | |
339 | 339 | /** @var null|string[] */ |
340 | - private static ?array $functionReplaceFromExcel; |
|
340 | + private static ? array $functionReplaceFromExcel; |
|
341 | 341 | |
342 | 342 | /** @var null|string[] */ |
343 | - private static ?array $functionReplaceToLocale; |
|
343 | + private static ? array $functionReplaceToLocale; |
|
344 | 344 | |
345 | 345 | public function translateFormulaToLocale(string $formula): string |
346 | 346 | { |
@@ -376,10 +376,10 @@ discard block |
||
376 | 376 | } |
377 | 377 | |
378 | 378 | /** @var null|string[] */ |
379 | - protected static ?array $functionReplaceFromLocale; |
|
379 | + protected static ? array $functionReplaceFromLocale; |
|
380 | 380 | |
381 | 381 | /** @var null|string[] */ |
382 | - protected static ?array $functionReplaceToExcel; |
|
382 | + protected static ? array $functionReplaceToExcel; |
|
383 | 383 | |
384 | 384 | public function translateFormulaToEnglish(string $formula): string |
385 | 385 | { |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * the column label in which you specify a condition for the |
26 | 26 | * column. |
27 | 27 | */ |
28 | - abstract public static function evaluate(array $database, array|null|int|string $field, array $criteria): null|float|int|string; |
|
28 | + abstract public static function evaluate(array $database, array | null | int | string $field, array $criteria): null | float | int | string; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * fieldExtract. |
@@ -51,7 +51,7 @@ |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | #[DataProvider('providerCONVERTUOM')] |
54 | - public function testDirectCallToCONVERTUOM(float|int|string $expectedResult, float|int|string $value, string $from, string $to): void |
|
54 | + public function testDirectCallToCONVERTUOM(float | int | string $expectedResult, float | int | string $value, string $from, string $to): void |
|
55 | 55 | { |
56 | 56 | $result = ConvertUOM::convert($value, $from, $to); |
57 | 57 | self::assertEqualsWithDelta($expectedResult, $result, self::UOM_PRECISION); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | return array_key_exists($key, self::EXCEL_CONSTANTS); |
164 | 164 | } |
165 | 165 | |
166 | - public static function getExcelConstants(string $key): bool|null |
|
166 | + public static function getExcelConstants(string $key): bool | null |
|
167 | 167 | { |
168 | 168 | return self::EXCEL_CONSTANTS[$key]; |
169 | 169 | } |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | * |
539 | 539 | * @param string $formula Formula to parse |
540 | 540 | */ |
541 | - public function parseFormula(string $formula): array|bool |
|
541 | + public function parseFormula(string $formula): array | bool |
|
542 | 542 | { |
543 | 543 | $formula = preg_replace_callback( |
544 | 544 | self::CALCULATION_REGEXP_CELLREF_SPILL, |
@@ -957,7 +957,7 @@ discard block |
||
957 | 957 | /** |
958 | 958 | * @return false|string False indicates an error |
959 | 959 | */ |
960 | - private function convertMatrixReferences(string $formula): false|string |
|
960 | + private function convertMatrixReferences(string $formula): false | string |
|
961 | 961 | { |
962 | 962 | static $matrixReplaceFrom = [self::FORMULA_OPEN_MATRIX_BRACE, ';', self::FORMULA_CLOSE_MATRIX_BRACE]; |
963 | 963 | static $matrixReplaceTo = ['MKMATRIX(MKMATRIX(', '),MKMATRIX(', '))']; |
@@ -1036,7 +1036,7 @@ discard block |
||
1036 | 1036 | /** |
1037 | 1037 | * @return array<int, mixed>|false |
1038 | 1038 | */ |
1039 | - private function internalParseFormula(string $formula, ?Cell $cell = null): bool|array |
|
1039 | + private function internalParseFormula(string $formula, ?Cell $cell = null): bool | array |
|
1040 | 1040 | { |
1041 | 1041 | if (($formula = $this->convertMatrixReferences(trim($formula))) === false) { |
1042 | 1042 | return false; |
@@ -1549,7 +1549,7 @@ discard block |
||
1549 | 1549 | /** |
1550 | 1550 | * @return array<int, mixed>|false|string |
1551 | 1551 | */ |
1552 | - private function processTokenStack(false|array $tokens, ?string $cellID = null, ?Cell $cell = null) |
|
1552 | + private function processTokenStack(false | array $tokens, ?string $cellID = null, ?Cell $cell = null) |
|
1553 | 1553 | { |
1554 | 1554 | if ($tokens === false) { |
1555 | 1555 | return false; |
@@ -2201,7 +2201,7 @@ discard block |
||
2201 | 2201 | return $output; |
2202 | 2202 | } |
2203 | 2203 | |
2204 | - private function validateBinaryOperand(mixed &$operand, Stack &$stack): bool |
|
2204 | + private function validateBinaryOperand(mixed &$operand, Stack & $stack): bool |
|
2205 | 2205 | { |
2206 | 2206 | if (is_array($operand)) { |
2207 | 2207 | if ((count($operand, COUNT_RECURSIVE) - count($operand)) == 1) { |
@@ -2240,7 +2240,7 @@ discard block |
||
2240 | 2240 | } |
2241 | 2241 | |
2242 | 2242 | /** @return mixed[] */ |
2243 | - private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays): array |
|
2243 | + private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays): array |
|
2244 | 2244 | { |
2245 | 2245 | $result = []; |
2246 | 2246 | if (!is_array($operand2) && is_array($operand1)) { |
@@ -2285,7 +2285,7 @@ discard block |
||
2285 | 2285 | } |
2286 | 2286 | |
2287 | 2287 | /** @return bool|mixed[] */ |
2288 | - private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays = false): array|bool |
|
2288 | + private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays = false): array | bool |
|
2289 | 2289 | { |
2290 | 2290 | // If we're dealing with matrix operations, we want a matrix result |
2291 | 2291 | if ((is_array($operand1)) || (is_array($operand2))) { |
@@ -2302,7 +2302,7 @@ discard block |
||
2302 | 2302 | return $result; |
2303 | 2303 | } |
2304 | 2304 | |
2305 | - private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack): mixed |
|
2305 | + private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack): mixed |
|
2306 | 2306 | { |
2307 | 2307 | // Validate the two operands |
2308 | 2308 | if ( |
@@ -2525,7 +2525,7 @@ discard block |
||
2525 | 2525 | * |
2526 | 2526 | * @return mixed[]|string Array of values in range if range contains more than one element. Otherwise, a single value is returned. |
2527 | 2527 | */ |
2528 | - public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string|array |
|
2528 | + public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string | array |
|
2529 | 2529 | { |
2530 | 2530 | // Return value |
2531 | 2531 | $returnValue = []; |
@@ -2674,7 +2674,7 @@ discard block |
||
2674 | 2674 | * |
2675 | 2675 | * @return mixed[] |
2676 | 2676 | */ |
2677 | - private function addCellReference(array $args, bool $passCellReference, array|string $functionCall, ?Cell $cell = null): array |
|
2677 | + private function addCellReference(array $args, bool $passCellReference, array | string $functionCall, ?Cell $cell = null): array |
|
2678 | 2678 | { |
2679 | 2679 | if ($passCellReference) { |
2680 | 2680 | if (is_array($functionCall)) { |