@@ -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); |
@@ -2029,26 +2029,26 @@ |
||
2029 | 2029 | } |
2030 | 2030 | } |
2031 | 2031 | |
2032 | - private static function getArrayItem(null|array|bool|SimpleXMLElement $array, int|string $key = 0): mixed |
|
2032 | + private static function getArrayItem(null | array | bool | SimpleXMLElement $array, int | string $key = 0): mixed |
|
2033 | 2033 | { |
2034 | 2034 | return ($array === null || is_bool($array)) ? null : ($array[$key] ?? null); |
2035 | 2035 | } |
2036 | 2036 | |
2037 | - private static function getArrayItemString(null|array|bool|SimpleXMLElement $array, int|string $key = 0): string |
|
2037 | + private static function getArrayItemString(null | array | bool | SimpleXMLElement $array, int | string $key = 0): string |
|
2038 | 2038 | { |
2039 | 2039 | $retVal = self::getArrayItem($array, $key); |
2040 | 2040 | |
2041 | 2041 | return StringHelper::convertToString($retVal, false); |
2042 | 2042 | } |
2043 | 2043 | |
2044 | - private static function getArrayItemIntOrSxml(null|array|bool|SimpleXMLElement $array, int|string $key = 0): int|SimpleXMLElement |
|
2044 | + private static function getArrayItemIntOrSxml(null | array | bool | SimpleXMLElement $array, int | string $key = 0): int | SimpleXMLElement |
|
2045 | 2045 | { |
2046 | 2046 | $retVal = self::getArrayItem($array, $key); |
2047 | 2047 | |
2048 | 2048 | return (is_int($retVal) || $retVal instanceof SimpleXMLElement) ? $retVal : 0; |
2049 | 2049 | } |
2050 | 2050 | |
2051 | - private static function dirAdd(null|SimpleXMLElement|string $base, null|SimpleXMLElement|string $add): string |
|
2051 | + private static function dirAdd(null | SimpleXMLElement | string $base, null | SimpleXMLElement | string $add): string |
|
2052 | 2052 | { |
2053 | 2053 | $base = (string) $base; |
2054 | 2054 | $add = (string) $add; |
@@ -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) |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | * |
255 | 255 | * @param-out string $cellContent In one case, it can be bool |
256 | 256 | */ |
257 | - protected function flushCell(Worksheet $sheet, string $column, int|string $row, mixed &$cellContent, array $attributeArray): void |
|
257 | + protected function flushCell(Worksheet $sheet, string $column, int | string $row, mixed &$cellContent, array $attributeArray): void |
|
258 | 258 | { |
259 | 259 | if (is_string($cellContent)) { |
260 | 260 | // Simple String content |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | /** @var array<int, array<int, string>> */ |
305 | 305 | private static array $falseTrueArray = []; |
306 | 306 | |
307 | - private static function convertBoolean(?string $cellContent): bool|string |
|
307 | + private static function convertBoolean(?string $cellContent): bool | string |
|
308 | 308 | { |
309 | 309 | if ($cellContent === '1') { |
310 | 310 | return true; |
@@ -892,7 +892,7 @@ discard block |
||
892 | 892 | * TODO : |
893 | 893 | * - Implement to other propertie, such as border |
894 | 894 | */ |
895 | - private function applyInlineStyle(Worksheet &$sheet, int $row, string $column, array $attributeArray): void |
|
895 | + private function applyInlineStyle(Worksheet & $sheet, int $row, string $column, array $attributeArray): void |
|
896 | 896 | { |
897 | 897 | if (!isset($attributeArray['style'])) { |
898 | 898 | return; |
@@ -1406,7 +1406,7 @@ discard block |
||
1406 | 1406 | } |
1407 | 1407 | } |
1408 | 1408 | |
1409 | - private function generateRowCellData(Worksheet $worksheet, null|Cell|string $cell, array|string &$cssClass): string |
|
1409 | + private function generateRowCellData(Worksheet $worksheet, null | Cell | string $cell, array | string &$cssClass): string |
|
1410 | 1410 | { |
1411 | 1411 | $cellData = ' '; |
1412 | 1412 | if ($cell instanceof Cell) { |
@@ -1487,7 +1487,7 @@ discard block |
||
1487 | 1487 | string $cellData, |
1488 | 1488 | int $colSpan, |
1489 | 1489 | int $rowSpan, |
1490 | - array|string $cssClass, |
|
1490 | + array | string $cssClass, |
|
1491 | 1491 | int $colNum, |
1492 | 1492 | int $sheetIndex, |
1493 | 1493 | int $row, |
@@ -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 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | #[DataProvider('providerDATE')] |
41 | - public function testDirectCallToDATE(float|string $expectedResult, int|string $year, null|bool|float|int|string $month, float|int|string $day): void |
|
41 | + public function testDirectCallToDATE(float | string $expectedResult, int | string $year, null | bool | float | int | string $month, float | int | string $day): void |
|
42 | 42 | { |
43 | 43 | $result = Date::fromYMD($year, $month, $day); |
44 | 44 | self::assertSame($expectedResult, $result); |