@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | return array_key_exists($key, self::$excelConstants); |
215 | 215 | } |
216 | 216 | |
217 | - public static function getExcelConstants(string $key): bool|null |
|
217 | + public static function getExcelConstants(string $key): bool | null |
|
218 | 218 | { |
219 | 219 | return self::$excelConstants[$key]; |
220 | 220 | } |
@@ -3314,9 +3314,9 @@ discard block |
||
3314 | 3314 | return $formula; |
3315 | 3315 | } |
3316 | 3316 | |
3317 | - private static ?array $functionReplaceFromExcel; |
|
3317 | + private static ? array $functionReplaceFromExcel; |
|
3318 | 3318 | |
3319 | - private static ?array $functionReplaceToLocale; |
|
3319 | + private static ? array $functionReplaceToLocale; |
|
3320 | 3320 | |
3321 | 3321 | public function translateFormulaToLocale(string $formula): string |
3322 | 3322 | { |
@@ -3351,9 +3351,9 @@ discard block |
||
3351 | 3351 | ); |
3352 | 3352 | } |
3353 | 3353 | |
3354 | - private static ?array $functionReplaceFromLocale; |
|
3354 | + private static ? array $functionReplaceFromLocale; |
|
3355 | 3355 | |
3356 | - private static ?array $functionReplaceToExcel; |
|
3356 | + private static ? array $functionReplaceToExcel; |
|
3357 | 3357 | |
3358 | 3358 | public function translateFormulaToEnglish(string $formula): string |
3359 | 3359 | { |
@@ -3538,7 +3538,7 @@ discard block |
||
3538 | 3538 | * |
3539 | 3539 | * @param string $formula Formula to parse |
3540 | 3540 | */ |
3541 | - public function parseFormula(string $formula): array|bool |
|
3541 | + public function parseFormula(string $formula): array | bool |
|
3542 | 3542 | { |
3543 | 3543 | $formula = preg_replace_callback( |
3544 | 3544 | self::CALCULATION_REGEXP_CELLREF_SPILL, |
@@ -3941,7 +3941,7 @@ discard block |
||
3941 | 3941 | /** |
3942 | 3942 | * @return false|string False indicates an error |
3943 | 3943 | */ |
3944 | - private function convertMatrixReferences(string $formula): false|string |
|
3944 | + private function convertMatrixReferences(string $formula): false | string |
|
3945 | 3945 | { |
3946 | 3946 | static $matrixReplaceFrom = [self::FORMULA_OPEN_MATRIX_BRACE, ';', self::FORMULA_CLOSE_MATRIX_BRACE]; |
3947 | 3947 | static $matrixReplaceTo = ['MKMATRIX(MKMATRIX(', '),MKMATRIX(', '))']; |
@@ -4036,7 +4036,7 @@ discard block |
||
4036 | 4036 | /** |
4037 | 4037 | * @return array<int, mixed>|false |
4038 | 4038 | */ |
4039 | - private function internalParseFormula(string $formula, ?Cell $cell = null): bool|array |
|
4039 | + private function internalParseFormula(string $formula, ?Cell $cell = null): bool | array |
|
4040 | 4040 | { |
4041 | 4041 | if (($formula = $this->convertMatrixReferences(trim($formula))) === false) { |
4042 | 4042 | return false; |
@@ -5210,7 +5210,7 @@ discard block |
||
5210 | 5210 | return true; |
5211 | 5211 | } |
5212 | 5212 | |
5213 | - private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays): array |
|
5213 | + private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays): array |
|
5214 | 5214 | { |
5215 | 5215 | $result = []; |
5216 | 5216 | if (!is_array($operand2)) { |
@@ -5249,7 +5249,7 @@ discard block |
||
5249 | 5249 | return $result; |
5250 | 5250 | } |
5251 | 5251 | |
5252 | - private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays = false): array|bool |
|
5252 | + private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays = false): array | bool |
|
5253 | 5253 | { |
5254 | 5254 | // If we're dealing with matrix operations, we want a matrix result |
5255 | 5255 | if ((is_array($operand1)) || (is_array($operand2))) { |
@@ -5266,7 +5266,7 @@ discard block |
||
5266 | 5266 | return $result; |
5267 | 5267 | } |
5268 | 5268 | |
5269 | - private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack): mixed |
|
5269 | + private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack): mixed |
|
5270 | 5270 | { |
5271 | 5271 | // Validate the two operands |
5272 | 5272 | if ( |
@@ -5483,7 +5483,7 @@ discard block |
||
5483 | 5483 | * |
5484 | 5484 | * @return array|string Array of values in range if range contains more than one element. Otherwise, a single value is returned. |
5485 | 5485 | */ |
5486 | - public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string|array |
|
5486 | + public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string | array |
|
5487 | 5487 | { |
5488 | 5488 | // Return value |
5489 | 5489 | $returnValue = []; |
@@ -5624,7 +5624,7 @@ discard block |
||
5624 | 5624 | /** |
5625 | 5625 | * Add cell reference if needed while making sure that it is the last argument. |
5626 | 5626 | */ |
5627 | - private function addCellReference(array $args, bool $passCellReference, array|string $functionCall, ?Cell $cell = null): array |
|
5627 | + private function addCellReference(array $args, bool $passCellReference, array | string $functionCall, ?Cell $cell = null): array |
|
5628 | 5628 | { |
5629 | 5629 | if ($passCellReference) { |
5630 | 5630 | if (is_array($functionCall)) { |
@@ -6,9 +6,9 @@ |
||
6 | 6 | |
7 | 7 | class StringableObject |
8 | 8 | { |
9 | - private int|string $value; |
|
9 | + private int | string $value; |
|
10 | 10 | |
11 | - public function __construct(int|string $value = 'abc') |
|
11 | + public function __construct(int | string $value = 'abc') |
|
12 | 12 | { |
13 | 13 | $this->value = $value; |
14 | 14 | } |
@@ -2013,26 +2013,26 @@ |
||
2013 | 2013 | } |
2014 | 2014 | } |
2015 | 2015 | |
2016 | - private static function getArrayItem(null|array|bool|SimpleXMLElement $array, int|string $key = 0): mixed |
|
2016 | + private static function getArrayItem(null | array | bool | SimpleXMLElement $array, int | string $key = 0): mixed |
|
2017 | 2017 | { |
2018 | 2018 | return ($array === null || is_bool($array)) ? null : ($array[$key] ?? null); |
2019 | 2019 | } |
2020 | 2020 | |
2021 | - private static function getArrayItemString(null|array|bool|SimpleXMLElement $array, int|string $key = 0): string |
|
2021 | + private static function getArrayItemString(null | array | bool | SimpleXMLElement $array, int | string $key = 0): string |
|
2022 | 2022 | { |
2023 | 2023 | $retVal = self::getArrayItem($array, $key); |
2024 | 2024 | |
2025 | 2025 | return ($retVal === null || is_scalar($retVal) || $retVal instanceof Stringable) ? ((string) $retVal) : ''; |
2026 | 2026 | } |
2027 | 2027 | |
2028 | - private static function getArrayItemIntOrSxml(null|array|bool|SimpleXMLElement $array, int|string $key = 0): int|SimpleXMLElement |
|
2028 | + private static function getArrayItemIntOrSxml(null | array | bool | SimpleXMLElement $array, int | string $key = 0): int | SimpleXMLElement |
|
2029 | 2029 | { |
2030 | 2030 | $retVal = self::getArrayItem($array, $key); |
2031 | 2031 | |
2032 | 2032 | return (is_int($retVal) || $retVal instanceof SimpleXMLElement) ? $retVal : 0; |
2033 | 2033 | } |
2034 | 2034 | |
2035 | - private static function dirAdd(null|SimpleXMLElement|string $base, null|SimpleXMLElement|string $add): string |
|
2035 | + private static function dirAdd(null | SimpleXMLElement | string $base, null | SimpleXMLElement | string $add): string |
|
2036 | 2036 | { |
2037 | 2037 | $base = (string) $base; |
2038 | 2038 | $add = (string) $add; |
@@ -681,7 +681,7 @@ |
||
681 | 681 | string $separator = ',', |
682 | 682 | string $enclosure = '"', |
683 | 683 | ?string $escape = null |
684 | - ): array|false { |
|
684 | + ): array | false { |
|
685 | 685 | $escape = $escape ?? self::$defaultEscapeCharacter; |
686 | 686 | if (PHP_VERSION_ID >= 80400 && $escape !== '') { |
687 | 687 | return @fgetcsv($stream, $length, $separator, $enclosure, $escape); |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | } |
377 | 377 | } |
378 | 378 | |
379 | - private function processMemoryDrawing(BstoreContainer &$bstoreContainer, MemoryDrawing $drawing, string $renderingFunctionx): void |
|
379 | + private function processMemoryDrawing(BstoreContainer & $bstoreContainer, MemoryDrawing $drawing, string $renderingFunctionx): void |
|
380 | 380 | { |
381 | 381 | switch ($renderingFunctionx) { |
382 | 382 | case MemoryDrawing::RENDERING_JPEG: |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | |
409 | 409 | private static int $two = 2; // phpstan silliness |
410 | 410 | |
411 | - private function processDrawing(BstoreContainer &$bstoreContainer, Drawing $drawing): void |
|
411 | + private function processDrawing(BstoreContainer & $bstoreContainer, Drawing $drawing): void |
|
412 | 412 | { |
413 | 413 | $blipType = 0; |
414 | 414 | $blipData = ''; |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | } |
466 | 466 | } |
467 | 467 | |
468 | - private function processBaseDrawing(BstoreContainer &$bstoreContainer, BaseDrawing $drawing): void |
|
468 | + private function processBaseDrawing(BstoreContainer & $bstoreContainer, BaseDrawing $drawing): void |
|
469 | 469 | { |
470 | 470 | if ($drawing instanceof Drawing && $drawing->getPath() !== '') { |
471 | 471 | $this->processDrawing($bstoreContainer, $drawing); |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | return $data; |
753 | 753 | } |
754 | 754 | |
755 | - private function writeSummaryPropOle(float|int $dataProp, int &$dataSection_NumProps, array &$dataSection, int $sumdata, int $typdata): void |
|
755 | + private function writeSummaryPropOle(float | int $dataProp, int &$dataSection_NumProps, array &$dataSection, int $sumdata, int $typdata): void |
|
756 | 756 | { |
757 | 757 | if ($dataProp) { |
758 | 758 | $dataSection[] = [ |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * If an array of numbers is passed as an argument, then the returned result will also be an array |
26 | 26 | * with the same dimensions |
27 | 27 | */ |
28 | - public static function evaluate(array|float|string|null $value = 0, array|float|int|string $digits = 0): array|float|string |
|
28 | + public static function evaluate(array | float | string | null $value = 0, array | float | int | string $digits = 0): array | float | string |
|
29 | 29 | { |
30 | 30 | if (is_array($value) || is_array($digits)) { |
31 | 31 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $digits); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * All other dates must be later than this date, but they may occur in any order |
31 | 31 | * @param mixed $guess An optional guess at the expected answer |
32 | 32 | */ |
33 | - public static function rate(array $values, array $dates, mixed $guess = self::DEFAULT_GUESS): float|string |
|
33 | + public static function rate(array $values, array $dates, mixed $guess = self::DEFAULT_GUESS): float | string |
|
34 | 34 | { |
35 | 35 | $rslt = self::xirrPart1($values, $dates); |
36 | 36 | if ($rslt !== '') { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * The first payment date indicates the beginning of the schedule of payments. |
118 | 118 | * All other dates must be later than this date, but they may occur in any order. |
119 | 119 | */ |
120 | - public static function presentValue(array|float $rate, array $values, array $dates): float|string |
|
120 | + public static function presentValue(array | float $rate, array $values, array $dates): float | string |
|
121 | 121 | { |
122 | 122 | return self::xnpvOrdered($rate, $values, $dates, true); |
123 | 123 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | return ''; |
175 | 175 | } |
176 | 176 | |
177 | - private static function xirrPart3(array $values, array $dates, float $x1, float $x2): float|string |
|
177 | + private static function xirrPart3(array $values, array $dates, float $x1, float $x2): float | string |
|
178 | 178 | { |
179 | 179 | $f = self::xnpvOrdered($x1, $values, $dates, false); |
180 | 180 | if ($f < 0.0) { |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | return $rslt; |
204 | 204 | } |
205 | 205 | |
206 | - private static function xirrBisection(array $values, array $dates, float $x1, float $x2): string|float |
|
206 | + private static function xirrBisection(array $values, array $dates, float $x1, float $x2): string | float |
|
207 | 207 | { |
208 | 208 | $rslt = ExcelError::NAN(); |
209 | 209 | for ($i = 0; $i < self::FINANCIAL_MAX_ITERATIONS; ++$i) { |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | } |
241 | 241 | |
242 | 242 | /** @param array<int,float|int|numeric-string> $values> */ |
243 | - private static function xnpvOrdered(mixed $rate, mixed $values, mixed $dates, bool $ordered = true, bool $capAtNegative1 = false): float|string |
|
243 | + private static function xnpvOrdered(mixed $rate, mixed $values, mixed $dates, bool $ordered = true, bool $capAtNegative1 = false): float | string |
|
244 | 244 | { |
245 | 245 | $rate = Functions::flattenSingleValue($rate); |
246 | 246 | $values = Functions::flattenArray($values); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | * @param string[] $formatBlocks |
15 | 15 | */ |
16 | 16 | #[\PHPUnit\Framework\Attributes\DataProvider('providerTime')] |
17 | - public function testTime(string $expectedResult, string|array|null $separators = null, array $formatBlocks = []): void |
|
17 | + public function testTime(string $expectedResult, string | array | null $separators = null, array $formatBlocks = []): void |
|
18 | 18 | { |
19 | 19 | $wizard = new Duration($separators, ...$formatBlocks); |
20 | 20 | self::assertSame($expectedResult, (string) $wizard); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | * @param string[] $formatBlocks |
15 | 15 | */ |
16 | 16 | #[\PHPUnit\Framework\Attributes\DataProvider('providerTime')] |
17 | - public function testTime(string $expectedResult, string|array|null $separators = null, array $formatBlocks = []): void |
|
17 | + public function testTime(string $expectedResult, string | array | null $separators = null, array $formatBlocks = []): void |
|
18 | 18 | { |
19 | 19 | $wizard = new Time($separators, ...$formatBlocks); |
20 | 20 | self::assertSame($expectedResult, (string) $wizard); |