@@ -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); |
@@ -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; |
@@ -327,9 +327,9 @@ discard block |
||
327 | 327 | return $formula; |
328 | 328 | } |
329 | 329 | |
330 | - private static ?array $functionReplaceFromExcel; |
|
330 | + private static ? array $functionReplaceFromExcel; |
|
331 | 331 | |
332 | - private static ?array $functionReplaceToLocale; |
|
332 | + private static ? array $functionReplaceToLocale; |
|
333 | 333 | |
334 | 334 | public function translateFormulaToLocale(string $formula): string |
335 | 335 | { |
@@ -364,9 +364,9 @@ discard block |
||
364 | 364 | ); |
365 | 365 | } |
366 | 366 | |
367 | - protected static ?array $functionReplaceFromLocale; |
|
367 | + protected static ? array $functionReplaceFromLocale; |
|
368 | 368 | |
369 | - protected static ?array $functionReplaceToExcel; |
|
369 | + protected static ? array $functionReplaceToExcel; |
|
370 | 370 | |
371 | 371 | public function translateFormulaToEnglish(string $formula): string |
372 | 372 | { |
@@ -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; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | return array_key_exists($key, self::EXCEL_CONSTANTS); |
162 | 162 | } |
163 | 163 | |
164 | - public static function getExcelConstants(string $key): bool|null |
|
164 | + public static function getExcelConstants(string $key): bool | null |
|
165 | 165 | { |
166 | 166 | return self::EXCEL_CONSTANTS[$key]; |
167 | 167 | } |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | * |
529 | 529 | * @param string $formula Formula to parse |
530 | 530 | */ |
531 | - public function parseFormula(string $formula): array|bool |
|
531 | + public function parseFormula(string $formula): array | bool |
|
532 | 532 | { |
533 | 533 | $formula = preg_replace_callback( |
534 | 534 | self::CALCULATION_REGEXP_CELLREF_SPILL, |
@@ -943,7 +943,7 @@ discard block |
||
943 | 943 | /** |
944 | 944 | * @return false|string False indicates an error |
945 | 945 | */ |
946 | - private function convertMatrixReferences(string $formula): false|string |
|
946 | + private function convertMatrixReferences(string $formula): false | string |
|
947 | 947 | { |
948 | 948 | static $matrixReplaceFrom = [self::FORMULA_OPEN_MATRIX_BRACE, ';', self::FORMULA_CLOSE_MATRIX_BRACE]; |
949 | 949 | static $matrixReplaceTo = ['MKMATRIX(MKMATRIX(', '),MKMATRIX(', '))']; |
@@ -1022,7 +1022,7 @@ discard block |
||
1022 | 1022 | /** |
1023 | 1023 | * @return array<int, mixed>|false |
1024 | 1024 | */ |
1025 | - private function internalParseFormula(string $formula, ?Cell $cell = null): bool|array |
|
1025 | + private function internalParseFormula(string $formula, ?Cell $cell = null): bool | array |
|
1026 | 1026 | { |
1027 | 1027 | if (($formula = $this->convertMatrixReferences(trim($formula))) === false) { |
1028 | 1028 | return false; |
@@ -1534,7 +1534,7 @@ discard block |
||
1534 | 1534 | /** |
1535 | 1535 | * @return array<int, mixed>|false|string |
1536 | 1536 | */ |
1537 | - private function processTokenStack(false|array $tokens, ?string $cellID = null, ?Cell $cell = null) |
|
1537 | + private function processTokenStack(false | array $tokens, ?string $cellID = null, ?Cell $cell = null) |
|
1538 | 1538 | { |
1539 | 1539 | if ($tokens === false) { |
1540 | 1540 | return false; |
@@ -2180,7 +2180,7 @@ discard block |
||
2180 | 2180 | return $output; |
2181 | 2181 | } |
2182 | 2182 | |
2183 | - private function validateBinaryOperand(mixed &$operand, Stack &$stack): bool |
|
2183 | + private function validateBinaryOperand(mixed &$operand, Stack & $stack): bool |
|
2184 | 2184 | { |
2185 | 2185 | if (is_array($operand)) { |
2186 | 2186 | if ((count($operand, COUNT_RECURSIVE) - count($operand)) == 1) { |
@@ -2218,7 +2218,7 @@ discard block |
||
2218 | 2218 | return true; |
2219 | 2219 | } |
2220 | 2220 | |
2221 | - private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays): array |
|
2221 | + private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays): array |
|
2222 | 2222 | { |
2223 | 2223 | $result = []; |
2224 | 2224 | if (!is_array($operand2) && is_array($operand1)) { |
@@ -2262,7 +2262,7 @@ discard block |
||
2262 | 2262 | return $result; |
2263 | 2263 | } |
2264 | 2264 | |
2265 | - private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays = false): array|bool |
|
2265 | + private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays = false): array | bool |
|
2266 | 2266 | { |
2267 | 2267 | // If we're dealing with matrix operations, we want a matrix result |
2268 | 2268 | if ((is_array($operand1)) || (is_array($operand2))) { |
@@ -2279,7 +2279,7 @@ discard block |
||
2279 | 2279 | return $result; |
2280 | 2280 | } |
2281 | 2281 | |
2282 | - private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack): mixed |
|
2282 | + private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack): mixed |
|
2283 | 2283 | { |
2284 | 2284 | // Validate the two operands |
2285 | 2285 | if ( |
@@ -2502,7 +2502,7 @@ discard block |
||
2502 | 2502 | * |
2503 | 2503 | * @return array|string Array of values in range if range contains more than one element. Otherwise, a single value is returned. |
2504 | 2504 | */ |
2505 | - public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string|array |
|
2505 | + public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string | array |
|
2506 | 2506 | { |
2507 | 2507 | // Return value |
2508 | 2508 | $returnValue = []; |
@@ -2637,7 +2637,7 @@ discard block |
||
2637 | 2637 | /** |
2638 | 2638 | * Add cell reference if needed while making sure that it is the last argument. |
2639 | 2639 | */ |
2640 | - private function addCellReference(array $args, bool $passCellReference, array|string $functionCall, ?Cell $cell = null): array |
|
2640 | + private function addCellReference(array $args, bool $passCellReference, array | string $functionCall, ?Cell $cell = null): array |
|
2641 | 2641 | { |
2642 | 2642 | if ($passCellReference) { |
2643 | 2643 | if (is_array($functionCall)) { |
@@ -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, |