@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param null|array|string $condition the criteria that defines which cells will be checked |
30 | 30 | * @param mixed $averageRange Data values |
31 | 31 | */ |
32 | - public static function AVERAGEIF(mixed $range, null|array|string $condition, mixed $averageRange = []): null|int|float|string |
|
32 | + public static function AVERAGEIF(mixed $range, null | array | string $condition, mixed $averageRange = []): null | int | float | string |
|
33 | 33 | { |
34 | 34 | if (!is_array($range) || !is_array($averageRange) || array_key_exists(0, $range) || array_key_exists(0, $averageRange)) { |
35 | 35 | $refError = ExcelError::REF(); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @param mixed $args Pairs of Ranges and Criteria |
57 | 57 | */ |
58 | - public static function AVERAGEIFS(mixed ...$args): null|int|float|string |
|
58 | + public static function AVERAGEIFS(mixed ...$args): null | int | float | string |
|
59 | 59 | { |
60 | 60 | if (empty($args)) { |
61 | 61 | return 0.0; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @param mixed $range Data values, expect array |
86 | 86 | * @param null|array|string $condition the criteria that defines which cells will be counted |
87 | 87 | */ |
88 | - public static function COUNTIF(mixed $range, null|array|string $condition): string|int |
|
88 | + public static function COUNTIF(mixed $range, null | array | string $condition): string | int |
|
89 | 89 | { |
90 | 90 | if ( |
91 | 91 | !is_array($range) |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * |
120 | 120 | * @param mixed $args Pairs of Ranges and Criteria |
121 | 121 | */ |
122 | - public static function COUNTIFS(mixed ...$args): int|string |
|
122 | + public static function COUNTIFS(mixed ...$args): int | string |
|
123 | 123 | { |
124 | 124 | if (empty($args)) { |
125 | 125 | return 0; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * |
144 | 144 | * @param mixed $args Pairs of Ranges and Criteria |
145 | 145 | */ |
146 | - public static function MAXIFS(mixed ...$args): null|float|string |
|
146 | + public static function MAXIFS(mixed ...$args): null | float | string |
|
147 | 147 | { |
148 | 148 | if (empty($args)) { |
149 | 149 | return 0.0; |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * |
166 | 166 | * @param mixed $args Pairs of Ranges and Criteria |
167 | 167 | */ |
168 | - public static function MINIFS(mixed ...$args): null|float|string |
|
168 | + public static function MINIFS(mixed ...$args): null | float | string |
|
169 | 169 | { |
170 | 170 | if (empty($args)) { |
171 | 171 | return 0.0; |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | * @param mixed $range Data values, expecting array |
189 | 189 | * @param mixed $sumRange Data values, expecting array |
190 | 190 | */ |
191 | - public static function SUMIF(mixed $range, mixed $condition, mixed $sumRange = []): null|float|string |
|
191 | + public static function SUMIF(mixed $range, mixed $condition, mixed $sumRange = []): null | float | string |
|
192 | 192 | { |
193 | 193 | if ( |
194 | 194 | !is_array($range) |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * |
220 | 220 | * @param mixed $args Pairs of Ranges and Criteria |
221 | 221 | */ |
222 | - public static function SUMIFS(mixed ...$args): null|float|string |
|
222 | + public static function SUMIFS(mixed ...$args): null | float | string |
|
223 | 223 | { |
224 | 224 | if (empty($args)) { |
225 | 225 | return 0.0; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | #[DataProvider('providerOCT2DEC')] |
32 | - public function testDirectCallToOCT2DEC(mixed $expectedResult, bool|string $value): void |
|
32 | + public function testDirectCallToOCT2DEC(mixed $expectedResult, bool | string $value): void |
|
33 | 33 | { |
34 | 34 | $result = ConvertOctal::toDecimal($value); |
35 | 35 | self::assertSame($expectedResult, $result); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | #[DataProvider('providerOCT2DECOds')] |
101 | - public function testOCT2DECOds(mixed $expectedResult, bool|string $value): void |
|
101 | + public function testOCT2DECOds(mixed $expectedResult, bool | string $value): void |
|
102 | 102 | { |
103 | 103 | Functions::setCompatibilityMode( |
104 | 104 | Functions::COMPATIBILITY_OPENOFFICE |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | #[DataProvider('providerBIN2DEC')] |
32 | - public function testDirectCallToBIN2DEC(float|int|string $expectedResult, bool|int|string $arg1): void |
|
32 | + public function testDirectCallToBIN2DEC(float | int | string $expectedResult, bool | int | string $arg1): void |
|
33 | 33 | { |
34 | 34 | $result = ConvertBinary::toDecimal($arg1); |
35 | 35 | self::assertSame($expectedResult, $result); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | #[DataProvider('providerBIN2DECOds')] |
101 | - public function testBIN2DECOds(float|int|string $expectedResult, bool $arg1): void |
|
101 | + public function testBIN2DECOds(float | int | string $expectedResult, bool $arg1): void |
|
102 | 102 | { |
103 | 103 | Functions::setCompatibilityMode( |
104 | 104 | Functions::COMPATIBILITY_OPENOFFICE |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | #[DataProvider('providerHEX2DEC')] |
32 | - public function testDirectCallToHEX2DEC(mixed $expectedResult, bool|float|int|string $value): void |
|
32 | + public function testDirectCallToHEX2DEC(mixed $expectedResult, bool | float | int | string $value): void |
|
33 | 33 | { |
34 | 34 | $result = ConvertHex::toDecimal($value); |
35 | 35 | self::assertSame($expectedResult, $result); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | #[DataProvider('providerHEX2DECOds')] |
101 | - public function testHEX2DECOds(mixed $expectedResult, bool|float|int|string $value): void |
|
101 | + public function testHEX2DECOds(mixed $expectedResult, bool | float | int | string $value): void |
|
102 | 102 | { |
103 | 103 | Functions::setCompatibilityMode( |
104 | 104 | Functions::COMPATIBILITY_OPENOFFICE |
@@ -9,7 +9,7 @@ |
||
9 | 9 | |
10 | 10 | class CustomFunction |
11 | 11 | { |
12 | - public static function fourthPower(mixed $number): float|int|string |
|
12 | + public static function fourthPower(mixed $number): float | int | string |
|
13 | 13 | { |
14 | 14 | try { |
15 | 15 | $number = Helpers::validateNumericNullBool($number); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | class MySpreadsheet extends Spreadsheet |
10 | 10 | { |
11 | - public function calcSquare(string $cellAddress): float|int|string |
|
11 | + public function calcSquare(string $cellAddress): float | int | string |
|
12 | 12 | { |
13 | 13 | $value = $this->getActiveSheet() |
14 | 14 | ->getCell($cellAddress) |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @return int|string Result, or a string containing an error |
26 | 26 | */ |
27 | - public static function daysPerYear(mixed $year, $basis = 0): string|int |
|
27 | + public static function daysPerYear(mixed $year, $basis = 0): string | int |
|
28 | 28 | { |
29 | 29 | if (!is_int($year) && !is_string($year)) { |
30 | 30 | return ExcelError::VALUE(); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * All other dates must be later than this date, but they may occur in any order |
32 | 32 | * @param mixed $guess An optional guess at the expected answer |
33 | 33 | */ |
34 | - public static function rate(mixed $values, $dates, mixed $guess = self::DEFAULT_GUESS): float|string |
|
34 | + public static function rate(mixed $values, $dates, mixed $guess = self::DEFAULT_GUESS): float | string |
|
35 | 35 | { |
36 | 36 | $rslt = self::xirrPart1($values, $dates); |
37 | 37 | /** @var array $dates */ |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * The first payment date indicates the beginning of the schedule of payments. |
120 | 120 | * All other dates must be later than this date, but they may occur in any order. |
121 | 121 | */ |
122 | - public static function presentValue(mixed $rate, mixed $values, mixed $dates): float|string |
|
122 | + public static function presentValue(mixed $rate, mixed $values, mixed $dates): float | string |
|
123 | 123 | { |
124 | 124 | return self::xnpvOrdered($rate, $values, $dates, true); |
125 | 125 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | return ''; |
179 | 179 | } |
180 | 180 | |
181 | - private static function xirrPart3(array $values, array $dates, float $x1, float $x2): float|string |
|
181 | + private static function xirrPart3(array $values, array $dates, float $x1, float $x2): float | string |
|
182 | 182 | { |
183 | 183 | $f = self::xnpvOrdered($x1, $values, $dates, false); |
184 | 184 | if ($f < 0.0) { |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | return $rslt; |
208 | 208 | } |
209 | 209 | |
210 | - private static function xirrBisection(array $values, array $dates, float $x1, float $x2): string|float |
|
210 | + private static function xirrBisection(array $values, array $dates, float $x1, float $x2): string | float |
|
211 | 211 | { |
212 | 212 | $rslt = ExcelError::NAN(); |
213 | 213 | for ($i = 0; $i < self::FINANCIAL_MAX_ITERATIONS; ++$i) { |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | } |
245 | 245 | |
246 | 246 | /** @param array<int,float|int|numeric-string> $values> */ |
247 | - private static function xnpvOrdered(mixed $rate, mixed $values, mixed $dates, bool $ordered = true, bool $capAtNegative1 = false): float|string |
|
247 | + private static function xnpvOrdered(mixed $rate, mixed $values, mixed $dates, bool $ordered = true, bool $capAtNegative1 = false): float | string |
|
248 | 248 | { |
249 | 249 | $rate = Functions::flattenSingleValue($rate); |
250 | 250 | if (!is_numeric($rate)) { |
@@ -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 | $year = (int) $year; |
23 | 23 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @return float|string Excel date/time serial value, or string if error |
66 | 66 | */ |
67 | - public static function getTimeValue(string $timeValue): string|float |
|
67 | + public static function getTimeValue(string $timeValue): string | float |
|
68 | 68 | { |
69 | 69 | $saveReturnDateType = Functions::getReturnDateType(); |
70 | 70 | Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | /** |
133 | 133 | * Return result in one of three formats. |
134 | 134 | */ |
135 | - public static function returnIn3FormatsArray(array $dateArray, bool $noFrac = false): DateTime|float|int |
|
135 | + public static function returnIn3FormatsArray(array $dateArray, bool $noFrac = false): DateTime | float | int |
|
136 | 136 | { |
137 | 137 | $retType = Functions::getReturnDateType(); |
138 | 138 | if ($retType === Functions::RETURNDATE_PHP_DATETIME_OBJECT) { |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | /** |
166 | 166 | * Return result in one of three formats. |
167 | 167 | */ |
168 | - public static function returnIn3FormatsFloat(float $excelDateValue): float|int|DateTime |
|
168 | + public static function returnIn3FormatsFloat(float $excelDateValue): float | int | DateTime |
|
169 | 169 | { |
170 | 170 | $retType = Functions::getReturnDateType(); |
171 | 171 | if ($retType === Functions::RETURNDATE_EXCEL) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | /** |
183 | 183 | * Return result in one of three formats. |
184 | 184 | */ |
185 | - public static function returnIn3FormatsObject(DateTime $PHPDateObject): DateTime|float|int |
|
185 | + public static function returnIn3FormatsObject(DateTime $PHPDateObject): DateTime | float | int |
|
186 | 186 | { |
187 | 187 | $retType = Functions::getReturnDateType(); |
188 | 188 | if ($retType === Functions::RETURNDATE_PHP_DATETIME_OBJECT) { |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | /** |
228 | 228 | * Many functions accept null argument treated as 0. |
229 | 229 | */ |
230 | - public static function validateNumericNull(mixed $number): int|float |
|
230 | + public static function validateNumericNull(mixed $number): int | float |
|
231 | 231 | { |
232 | 232 | $number = Functions::flattenSingleValue($number); |
233 | 233 | if ($number === null) { |
@@ -284,12 +284,12 @@ discard block |
||
284 | 284 | * |
285 | 285 | * @param array|false $dateArray |
286 | 286 | */ |
287 | - private static function forceArray(array|bool $dateArray): array |
|
287 | + private static function forceArray(array | bool $dateArray): array |
|
288 | 288 | { |
289 | 289 | return is_array($dateArray) ? $dateArray : ['error_count' => 1]; |
290 | 290 | } |
291 | 291 | |
292 | - public static function floatOrInt(mixed $value): float|int |
|
292 | + public static function floatOrInt(mixed $value): float | int |
|
293 | 293 | { |
294 | 294 | $result = Functions::scalar($value); |
295 | 295 |