@@ -6,11 +6,11 @@ discard block |
||
6 | 6 | { |
7 | 7 | private string $type; |
8 | 8 | |
9 | - private null|float|int|string $value; |
|
9 | + private null | float | int | string $value; |
|
10 | 10 | |
11 | 11 | private ?string $cellFormula; |
12 | 12 | |
13 | - public function __construct(string $type, null|float|int|string $value = null, ?string $cellFormula = null) |
|
13 | + public function __construct(string $type, null | float | int | string $value = null, ?string $cellFormula = null) |
|
14 | 14 | { |
15 | 15 | $this->type = $type; |
16 | 16 | $this->value = $value; |
@@ -29,12 +29,12 @@ discard block |
||
29 | 29 | return $this; |
30 | 30 | } |
31 | 31 | |
32 | - public function getValue(): null|float|int|string |
|
32 | + public function getValue(): null | float | int | string |
|
33 | 33 | { |
34 | 34 | return $this->value; |
35 | 35 | } |
36 | 36 | |
37 | - public function setValue(null|float|int|string $value): self |
|
37 | + public function setValue(null | float | int | string $value): self |
|
38 | 38 | { |
39 | 39 | $this->value = $value; |
40 | 40 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * |
18 | 18 | * @return bool TRUE if the year is a leap year, otherwise FALSE |
19 | 19 | */ |
20 | - public static function isLeapYear(int|string $year): bool |
|
20 | + public static function isLeapYear(int | string $year): bool |
|
21 | 21 | { |
22 | 22 | return (($year % 4) === 0) && (($year % 100) !== 0) || (($year % 400) === 0); |
23 | 23 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @return float|string Excel date/time serial value, or string if error |
62 | 62 | */ |
63 | - public static function getTimeValue(string $timeValue): string|float |
|
63 | + public static function getTimeValue(string $timeValue): string | float |
|
64 | 64 | { |
65 | 65 | $saveReturnDateType = Functions::getReturnDateType(); |
66 | 66 | Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | /** |
127 | 127 | * Return result in one of three formats. |
128 | 128 | */ |
129 | - public static function returnIn3FormatsArray(array $dateArray, bool $noFrac = false): DateTime|float|int |
|
129 | + public static function returnIn3FormatsArray(array $dateArray, bool $noFrac = false): DateTime | float | int |
|
130 | 130 | { |
131 | 131 | $retType = Functions::getReturnDateType(); |
132 | 132 | if ($retType === Functions::RETURNDATE_PHP_DATETIME_OBJECT) { |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | /** |
160 | 160 | * Return result in one of three formats. |
161 | 161 | */ |
162 | - public static function returnIn3FormatsFloat(float $excelDateValue): float|int|DateTime |
|
162 | + public static function returnIn3FormatsFloat(float $excelDateValue): float | int | DateTime |
|
163 | 163 | { |
164 | 164 | $retType = Functions::getReturnDateType(); |
165 | 165 | if ($retType === Functions::RETURNDATE_EXCEL) { |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | /** |
177 | 177 | * Return result in one of three formats. |
178 | 178 | */ |
179 | - public static function returnIn3FormatsObject(DateTime $PHPDateObject): DateTime|float|int |
|
179 | + public static function returnIn3FormatsObject(DateTime $PHPDateObject): DateTime | float | int |
|
180 | 180 | { |
181 | 181 | $retType = Functions::getReturnDateType(); |
182 | 182 | if ($retType === Functions::RETURNDATE_PHP_DATETIME_OBJECT) { |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | /** |
222 | 222 | * Many functions accept null argument treated as 0. |
223 | 223 | */ |
224 | - public static function validateNumericNull(mixed $number): int|float |
|
224 | + public static function validateNumericNull(mixed $number): int | float |
|
225 | 225 | { |
226 | 226 | $number = Functions::flattenSingleValue($number); |
227 | 227 | if ($number === null) { |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | * |
279 | 279 | * @param array|false $dateArray |
280 | 280 | */ |
281 | - private static function forceArray(array|bool $dateArray): array |
|
281 | + private static function forceArray(array | bool $dateArray): array |
|
282 | 282 | { |
283 | 283 | return is_array($dateArray) ? $dateArray : ['error_count' => 1]; |
284 | 284 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @return DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object, |
26 | 26 | * depending on the value of the ReturnDateType flag |
27 | 27 | */ |
28 | - public static function today(): DateTime|float|int|string |
|
28 | + public static function today(): DateTime | float | int | string |
|
29 | 29 | { |
30 | 30 | $dti = new DateTimeImmutable(); |
31 | 31 | $dateArray = Helpers::dateParse($dti->format('c')); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @return DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object, |
51 | 51 | * depending on the value of the ReturnDateType flag |
52 | 52 | */ |
53 | - public static function now(): DateTime|float|int|string |
|
53 | + public static function now(): DateTime | float | int | string |
|
54 | 54 | { |
55 | 55 | $dti = new DateTimeImmutable(); |
56 | 56 | $dateArray = Helpers::dateParse($dti->format('c')); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * If an array of values is passed as the argument, then the returned result will also be an array |
35 | 35 | * with the same dimensions |
36 | 36 | */ |
37 | - public static function adjust(mixed $dateValue, array|string|bool|float|int $adjustmentMonths): DateTime|float|int|string|array |
|
37 | + public static function adjust(mixed $dateValue, array | string | bool | float | int $adjustmentMonths): DateTime | float | int | string | array |
|
38 | 38 | { |
39 | 39 | if (is_array($dateValue) || is_array($adjustmentMonths)) { |
40 | 40 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $dateValue, $adjustmentMonths); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * If an array of values is passed as the argument, then the returned result will also be an array |
79 | 79 | * with the same dimensions |
80 | 80 | */ |
81 | - public static function lastDay(mixed $dateValue, array|float|int|bool|string $adjustmentMonths): array|string|DateTime|float|int |
|
81 | + public static function lastDay(mixed $dateValue, array | float | int | bool | string $adjustmentMonths): array | string | DateTime | float | int |
|
82 | 82 | { |
83 | 83 | if (is_array($dateValue) || is_array($adjustmentMonths)) { |
84 | 84 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $dateValue, $adjustmentMonths); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * If an array of numbers is passed as the argument, then the returned result will also be an array |
41 | 41 | * with the same dimensions |
42 | 42 | */ |
43 | - public static function fromString(null|array|string|int|bool|float $dateValue): array|string|float|int|DateTime |
|
43 | + public static function fromString(null | array | string | int | bool | float $dateValue): array | string | float | int | DateTime |
|
44 | 44 | { |
45 | 45 | if (is_array($dateValue)) { |
46 | 46 | return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $dateValue); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @return DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object, |
136 | 136 | * depending on the value of the ReturnDateType flag |
137 | 137 | */ |
138 | - private static function finalResults(array $PHPDateArray, DateTimeImmutable $dti, int $baseYear): string|float|int|DateTime |
|
138 | + private static function finalResults(array $PHPDateArray, DateTimeImmutable $dti, int $baseYear): string | float | int | DateTime |
|
139 | 139 | { |
140 | 140 | $retValue = ExcelError::Value(); |
141 | 141 | if (Helpers::dateParseSucceeded($PHPDateArray)) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * If an array of values is passed for the $startDate or $endDays,arguments, then the returned result |
37 | 37 | * will also be an array with matching dimensions |
38 | 38 | */ |
39 | - public static function date(mixed $startDate, array|int|string $endDays, mixed ...$dateArgs): array|float|int|DateTime|string |
|
39 | + public static function date(mixed $startDate, array | int | string $endDays, mixed ...$dateArgs): array | float | int | DateTime | string |
|
40 | 40 | { |
41 | 41 | if (is_array($startDate) || is_array($endDays)) { |
42 | 42 | return self::evaluateArrayArgumentsSubset( |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | /** |
74 | 74 | * Use incrementing logic to determine Workday. |
75 | 75 | */ |
76 | - private static function incrementing(float $startDate, int $endDays, array $holidayArray): float|int|DateTime |
|
76 | + private static function incrementing(float $startDate, int $endDays, array $holidayArray): float | int | DateTime |
|
77 | 77 | { |
78 | 78 | // Adjust the start date if it falls over a weekend |
79 | 79 | $startDoW = self::getWeekDay($startDate, 3); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | /** |
133 | 133 | * Use decrementing logic to determine Workday. |
134 | 134 | */ |
135 | - private static function decrementing(float $startDate, int $endDays, array $holidayArray): float|int|DateTime |
|
135 | + private static function decrementing(float $startDate, int $endDays, array $holidayArray): float | int | DateTime |
|
136 | 136 | { |
137 | 137 | // Adjust the start date if it falls over a weekend |
138 | 138 | $startDoW = self::getWeekDay($startDate, 3); |
@@ -64,7 +64,7 @@ |
||
64 | 64 | * If an array of numbers is passed as the argument, then the returned result will also be an array |
65 | 65 | * with the same dimensions |
66 | 66 | */ |
67 | - public static function fromYMD(array|float|int|string $year, array|float|int|string $month, array|float|int|string $day): float|int|DateTime|string|array |
|
67 | + public static function fromYMD(array | float | int | string $year, array | float | int | string $month, array | float | int | string $day): float | int | DateTime | string | array |
|
68 | 68 | { |
69 | 69 | if (is_array($year) || is_array($month) || is_array($day)) { |
70 | 70 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $year, $month, $day); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | return array_key_exists($key, self::$excelConstants); |
209 | 209 | } |
210 | 210 | |
211 | - public static function getExcelConstants(string $key): bool|null |
|
211 | + public static function getExcelConstants(string $key): bool | null |
|
212 | 212 | { |
213 | 213 | return self::$excelConstants[$key]; |
214 | 214 | } |
@@ -3273,10 +3273,10 @@ discard block |
||
3273 | 3273 | } |
3274 | 3274 | |
3275 | 3275 | /** @var ?array */ |
3276 | - private static ?array $functionReplaceFromExcel; |
|
3276 | + private static ? array $functionReplaceFromExcel; |
|
3277 | 3277 | |
3278 | 3278 | /** @var ?array */ |
3279 | - private static ?array $functionReplaceToLocale; |
|
3279 | + private static ? array $functionReplaceToLocale; |
|
3280 | 3280 | |
3281 | 3281 | /** |
3282 | 3282 | * @deprecated 1.30.0 use translateFormulaToLocale() instead |
@@ -3322,10 +3322,10 @@ discard block |
||
3322 | 3322 | } |
3323 | 3323 | |
3324 | 3324 | /** @var ?array */ |
3325 | - private static ?array $functionReplaceFromLocale; |
|
3325 | + private static ? array $functionReplaceFromLocale; |
|
3326 | 3326 | |
3327 | 3327 | /** @var ?array */ |
3328 | - private static ?array $functionReplaceToExcel; |
|
3328 | + private static ? array $functionReplaceToExcel; |
|
3329 | 3329 | |
3330 | 3330 | /** |
3331 | 3331 | * @deprecated 1.30.0 use translateFormulaToEnglish() instead |
@@ -3533,7 +3533,7 @@ discard block |
||
3533 | 3533 | * |
3534 | 3534 | * @param string $formula Formula to parse |
3535 | 3535 | */ |
3536 | - public function parseFormula(string $formula): array|bool |
|
3536 | + public function parseFormula(string $formula): array | bool |
|
3537 | 3537 | { |
3538 | 3538 | // Basic validation that this is indeed a formula |
3539 | 3539 | // We return an empty array if not |
@@ -3927,7 +3927,7 @@ discard block |
||
3927 | 3927 | /** |
3928 | 3928 | * @return false|string False indicates an error |
3929 | 3929 | */ |
3930 | - private function convertMatrixReferences(string $formula): false|string |
|
3930 | + private function convertMatrixReferences(string $formula): false | string |
|
3931 | 3931 | { |
3932 | 3932 | static $matrixReplaceFrom = [self::FORMULA_OPEN_MATRIX_BRACE, ';', self::FORMULA_CLOSE_MATRIX_BRACE]; |
3933 | 3933 | static $matrixReplaceTo = ['MKMATRIX(MKMATRIX(', '),MKMATRIX(', '))']; |
@@ -4022,7 +4022,7 @@ discard block |
||
4022 | 4022 | /** |
4023 | 4023 | * @return array<int, mixed>|false |
4024 | 4024 | */ |
4025 | - private function internalParseFormula(string $formula, ?Cell $cell = null): bool|array |
|
4025 | + private function internalParseFormula(string $formula, ?Cell $cell = null): bool | array |
|
4026 | 4026 | { |
4027 | 4027 | if (($formula = $this->convertMatrixReferences(trim($formula))) === false) { |
4028 | 4028 | return false; |
@@ -5153,7 +5153,7 @@ discard block |
||
5153 | 5153 | return true; |
5154 | 5154 | } |
5155 | 5155 | |
5156 | - private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays): array |
|
5156 | + private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays): array |
|
5157 | 5157 | { |
5158 | 5158 | $result = []; |
5159 | 5159 | if (!is_array($operand2)) { |
@@ -5192,7 +5192,7 @@ discard block |
||
5192 | 5192 | return $result; |
5193 | 5193 | } |
5194 | 5194 | |
5195 | - private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays = false): array|bool |
|
5195 | + private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays = false): array | bool |
|
5196 | 5196 | { |
5197 | 5197 | // If we're dealing with matrix operations, we want a matrix result |
5198 | 5198 | if ((is_array($operand1)) || (is_array($operand2))) { |
@@ -5209,7 +5209,7 @@ discard block |
||
5209 | 5209 | return $result; |
5210 | 5210 | } |
5211 | 5211 | |
5212 | - private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack): mixed |
|
5212 | + private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack): mixed |
|
5213 | 5213 | { |
5214 | 5214 | // Validate the two operands |
5215 | 5215 | if ( |
@@ -5414,7 +5414,7 @@ discard block |
||
5414 | 5414 | * |
5415 | 5415 | * @return array|string Array of values in range if range contains more than one element. Otherwise, a single value is returned. |
5416 | 5416 | */ |
5417 | - public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string|array |
|
5417 | + public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string | array |
|
5418 | 5418 | { |
5419 | 5419 | // Return value |
5420 | 5420 | $returnValue = []; |
@@ -5555,7 +5555,7 @@ discard block |
||
5555 | 5555 | /** |
5556 | 5556 | * Add cell reference if needed while making sure that it is the last argument. |
5557 | 5557 | */ |
5558 | - private function addCellReference(array $args, bool $passCellReference, array|string $functionCall, ?Cell $cell = null): array |
|
5558 | + private function addCellReference(array $args, bool $passCellReference, array | string $functionCall, ?Cell $cell = null): array |
|
5559 | 5559 | { |
5560 | 5560 | if ($passCellReference) { |
5561 | 5561 | if (is_array($functionCall)) { |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | abstract class MaxMinBase |
6 | 6 | { |
7 | - protected static function datatypeAdjustmentAllowStrings(int|float|string|bool $value): int|float |
|
7 | + protected static function datatypeAdjustmentAllowStrings(int | float | string | bool $value): int | float |
|
8 | 8 | { |
9 | 9 | if (is_bool($value)) { |
10 | 10 | return (int) $value; |