@@ -132,7 +132,7 @@ |
||
132 | 132 | } |
133 | 133 | |
134 | 134 | #[DataProvider('providerRelative')] |
135 | - public function testR1C1Relative(string|int|null $expectedResult, string $address): void |
|
135 | + public function testR1C1Relative(string | int | null $expectedResult, string $address): void |
|
136 | 136 | { |
137 | 137 | $this->setArrayAsValue(); |
138 | 138 | $sheet = $this->getSheet(); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | class IndexOnSpreadsheetTest extends AllSetupTeardown |
10 | 10 | { |
11 | 11 | #[DataProvider('providerINDEXonSpreadsheet')] |
12 | - public function testIndexOnSpreadsheet(mixed $expectedResult, array $matrix, null|int|string $rowNum = null, null|int|string $colNum = null): void |
|
12 | + public function testIndexOnSpreadsheet(mixed $expectedResult, array $matrix, null | int | string $rowNum = null, null | int | string $colNum = null): void |
|
13 | 13 | { |
14 | 14 | $this->mightHaveException($expectedResult); |
15 | 15 | $this->setArrayAsValue(); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | } |
22 | 22 | |
23 | 23 | #[DataProvider('providerANDLiteral')] |
24 | - public function testANDLiteral(bool|string $expectedResult, float|int|string $formula): void |
|
24 | + public function testANDLiteral(bool | string $expectedResult, float | int | string $formula): void |
|
25 | 25 | { |
26 | 26 | $sheet = $this->getSheet(); |
27 | 27 | $sheet->getCell('A1')->setValue("=AND($formula)"); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @param mixed $principal the present value |
21 | 21 | * @param float[] $schedule an array of interest rates to apply |
22 | 22 | */ |
23 | - public static function futureValue(mixed $principal, array $schedule): string|float |
|
23 | + public static function futureValue(mixed $principal, array $schedule): string | float |
|
24 | 24 | { |
25 | 25 | $principal = Functions::flattenSingleValue($principal); |
26 | 26 | $schedule = Functions::flattenArray($schedule); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @return float|string Result, or a string containing an error |
52 | 52 | */ |
53 | - public static function periods(mixed $rate, mixed $presentValue, mixed $futureValue): string|float |
|
53 | + public static function periods(mixed $rate, mixed $presentValue, mixed $futureValue): string | float |
|
54 | 54 | { |
55 | 55 | $rate = Functions::flattenSingleValue($rate); |
56 | 56 | $presentValue = Functions::flattenSingleValue($presentValue); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * |
84 | 84 | * @return float|string Result, or a string containing an error |
85 | 85 | */ |
86 | - public static function interestRate(mixed $periods = 0.0, mixed $presentValue = 0.0, mixed $futureValue = 0.0): string|float |
|
86 | + public static function interestRate(mixed $periods = 0.0, mixed $presentValue = 0.0, mixed $futureValue = 0.0): string | float |
|
87 | 87 | { |
88 | 88 | $periods = Functions::flattenSingleValue($periods); |
89 | 89 | $presentValue = Functions::flattenSingleValue($presentValue); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | #[\PHPUnit\Framework\Attributes\DataProvider('providerDateTimeExcelToTimestamp1900')] |
55 | - public function testDateTimeExcelToTimestamp1900(float|int $expectedResult, float|int $excelDateTimeValue): void |
|
55 | + public function testDateTimeExcelToTimestamp1900(float | int $expectedResult, float | int $excelDateTimeValue): void |
|
56 | 56 | { |
57 | 57 | if ($expectedResult > PHP_INT_MAX || $expectedResult < PHP_INT_MIN) { |
58 | 58 | self::markTestSkipped('Test invalid on 32-bit system.'); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | #[\PHPUnit\Framework\Attributes\DataProvider('providerDateTimeTimestampToExcel1900')] |
72 | - public function testDateTimeTimestampToExcel1900(float|int $expectedResult, float|int|string $unixTimestamp): void |
|
72 | + public function testDateTimeTimestampToExcel1900(float | int $expectedResult, float | int | string $unixTimestamp): void |
|
73 | 73 | { |
74 | 74 | Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900); |
75 | 75 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | #[\PHPUnit\Framework\Attributes\DataProvider('providerDateTimeDateTimeToExcel')] |
86 | - public function testDateTimeDateTimeToExcel(float|int $expectedResult, DateTimeInterface $dateTimeObject): void |
|
86 | + public function testDateTimeDateTimeToExcel(float | int $expectedResult, DateTimeInterface $dateTimeObject): void |
|
87 | 87 | { |
88 | 88 | Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900); |
89 | 89 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | |
116 | 116 | #[\PHPUnit\Framework\Attributes\DataProvider('providerDateTimeExcelToTimestamp1904')] |
117 | - public function testDateTimeExcelToTimestamp1904(float|int $expectedResult, float|int $excelDateTimeValue): void |
|
117 | + public function testDateTimeExcelToTimestamp1904(float | int $expectedResult, float | int $excelDateTimeValue): void |
|
118 | 118 | { |
119 | 119 | if ($expectedResult > PHP_INT_MAX || $expectedResult < PHP_INT_MIN) { |
120 | 120 | self::markTestSkipped('Test invalid on 32-bit system.'); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | #[\PHPUnit\Framework\Attributes\DataProvider('providerDateTimeTimestampToExcel1904')] |
134 | - public function testDateTimeTimestampToExcel1904(mixed $expectedResult, float|int|string $unixTimestamp): void |
|
134 | + public function testDateTimeTimestampToExcel1904(mixed $expectedResult, float | int | string $unixTimestamp): void |
|
135 | 135 | { |
136 | 136 | Date::setExcelCalendar(Date::CALENDAR_MAC_1904); |
137 | 137 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | } |
158 | 158 | |
159 | 159 | #[\PHPUnit\Framework\Attributes\DataProvider('providerDateTimeExcelToTimestamp1900Timezone')] |
160 | - public function testDateTimeExcelToTimestamp1900Timezone(float|int $expectedResult, float|int $excelDateTimeValue, string $timezone): void |
|
160 | + public function testDateTimeExcelToTimestamp1900Timezone(float | int $expectedResult, float | int $excelDateTimeValue, string $timezone): void |
|
161 | 161 | { |
162 | 162 | if ($expectedResult > PHP_INT_MAX || $expectedResult < PHP_INT_MIN) { |
163 | 163 | self::markTestSkipped('Test invalid on 32-bit system.'); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * |
47 | 47 | * @param float|string $operand string value to test |
48 | 48 | */ |
49 | - public static function convertToNumberIfNumeric(float|string &$operand): bool |
|
49 | + public static function convertToNumberIfNumeric(float | string &$operand): bool |
|
50 | 50 | { |
51 | 51 | $thousandsSeparator = preg_quote(StringHelper::getThousandsSeparator(), '/'); |
52 | 52 | $value = preg_replace(['/(\d)' . $thousandsSeparator . '(\d)/u', '/([+-])\s+(\d)/u'], ['$1$2', '$1$2'], trim("$operand")); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * |
89 | 89 | * @param float|string $operand string value to test |
90 | 90 | */ |
91 | - public static function convertToNumberIfPercent(float|string &$operand): bool |
|
91 | + public static function convertToNumberIfPercent(float | string &$operand): bool |
|
92 | 92 | { |
93 | 93 | $thousandsSeparator = preg_quote(StringHelper::getThousandsSeparator(), '/'); |
94 | 94 | $value = preg_replace('/(\d)' . $thousandsSeparator . '(\d)/u', '$1$2', trim("$operand")); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @param float|string $operand string value to test |
115 | 115 | */ |
116 | - public static function convertToNumberIfCurrency(float|string &$operand): bool |
|
116 | + public static function convertToNumberIfCurrency(float | string &$operand): bool |
|
117 | 117 | { |
118 | 118 | $currencyRegexp = self::currencyMatcherRegexp(); |
119 | 119 | $thousandsSeparator = preg_quote(StringHelper::getThousandsSeparator(), '/'); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | class OffsetTest extends AllSetupTeardown |
12 | 12 | { |
13 | 13 | #[DataProvider('providerOFFSET')] |
14 | - public function testOFFSET(mixed $expectedResult, null|string $cellReference = null): void |
|
14 | + public function testOFFSET(mixed $expectedResult, null | string $cellReference = null): void |
|
15 | 15 | { |
16 | 16 | $result = LookupRef\Offset::OFFSET($cellReference); |
17 | 17 | self::assertSame($expectedResult, $result); |
@@ -1112,7 +1112,7 @@ discard block |
||
1112 | 1112 | * |
1113 | 1113 | * @return $this |
1114 | 1114 | */ |
1115 | - public function setCellValue(CellAddress|string|array $coordinate, mixed $value, ?IValueBinder $binder = null): static |
|
1115 | + public function setCellValue(CellAddress | string | array $coordinate, mixed $value, ?IValueBinder $binder = null): static |
|
1116 | 1116 | { |
1117 | 1117 | $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($coordinate)); |
1118 | 1118 | $this->getCell($cellAddress)->setValue($value, $binder); |
@@ -1137,7 +1137,7 @@ discard block |
||
1137 | 1137 | * |
1138 | 1138 | * @return $this |
1139 | 1139 | */ |
1140 | - public function setCellValueExplicit(CellAddress|string|array $coordinate, mixed $value, string $dataType): static |
|
1140 | + public function setCellValueExplicit(CellAddress | string | array $coordinate, mixed $value, string $dataType): static |
|
1141 | 1141 | { |
1142 | 1142 | $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($coordinate)); |
1143 | 1143 | $this->getCell($cellAddress)->setValueExplicit($value, $dataType); |
@@ -1158,7 +1158,7 @@ discard block |
||
1158 | 1158 | * the "active" cell, and any previous assignment becomes a disconnected reference because |
1159 | 1159 | * the active cell has changed. |
1160 | 1160 | */ |
1161 | - public function getCell(CellAddress|string|array $coordinate): Cell |
|
1161 | + public function getCell(CellAddress | string | array $coordinate): Cell |
|
1162 | 1162 | { |
1163 | 1163 | $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($coordinate)); |
1164 | 1164 | |
@@ -1303,7 +1303,7 @@ discard block |
||
1303 | 1303 | * @param array{0: int, 1: int}|CellAddress|string $coordinate Coordinate of the cell as a string, eg: 'C5'; |
1304 | 1304 | * or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object. |
1305 | 1305 | */ |
1306 | - public function cellExists(CellAddress|string|array $coordinate): bool |
|
1306 | + public function cellExists(CellAddress | string | array $coordinate): bool |
|
1307 | 1307 | { |
1308 | 1308 | $cellAddress = Validations::validateCellAddress($coordinate); |
1309 | 1309 | [$sheet, $finalCoordinate] = $this->getWorksheetAndCoordinate($cellAddress); |
@@ -1393,7 +1393,7 @@ discard block |
||
1393 | 1393 | * or passing in an array of [$fromColumnIndex, $fromRow, $toColumnIndex, $toRow] (e.g. [3, 5, 6, 8]), |
1394 | 1394 | * or a CellAddress or AddressRange object. |
1395 | 1395 | */ |
1396 | - public function getStyle(AddressRange|CellAddress|int|string|array $cellCoordinate): Style |
|
1396 | + public function getStyle(AddressRange | CellAddress | int | string | array $cellCoordinate): Style |
|
1397 | 1397 | { |
1398 | 1398 | if (is_string($cellCoordinate)) { |
1399 | 1399 | $cellCoordinate = Validations::definedNameToCoordinate($cellCoordinate, $this); |
@@ -1639,7 +1639,7 @@ discard block |
||
1639 | 1639 | * |
1640 | 1640 | * @return $this |
1641 | 1641 | */ |
1642 | - public function setBreak(CellAddress|string|array $coordinate, int $break, int $max = -1): static |
|
1642 | + public function setBreak(CellAddress | string | array $coordinate, int $break, int $max = -1): static |
|
1643 | 1643 | { |
1644 | 1644 | $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($coordinate)); |
1645 | 1645 | |
@@ -1736,7 +1736,7 @@ discard block |
||
1736 | 1736 | * |
1737 | 1737 | * @return $this |
1738 | 1738 | */ |
1739 | - public function mergeCells(AddressRange|string|array $range, string $behaviour = self::MERGE_CELL_CONTENT_EMPTY): static |
|
1739 | + public function mergeCells(AddressRange | string | array $range, string $behaviour = self::MERGE_CELL_CONTENT_EMPTY): static |
|
1740 | 1740 | { |
1741 | 1741 | $range = Functions::trimSheetFromCellReference(Validations::validateCellRange($range)); |
1742 | 1742 | |
@@ -1856,7 +1856,7 @@ discard block |
||
1856 | 1856 | * |
1857 | 1857 | * @return $this |
1858 | 1858 | */ |
1859 | - public function unmergeCells(AddressRange|string|array $range): static |
|
1859 | + public function unmergeCells(AddressRange | string | array $range): static |
|
1860 | 1860 | { |
1861 | 1861 | $range = Functions::trimSheetFromCellReference(Validations::validateCellRange($range)); |
1862 | 1862 | |
@@ -1909,7 +1909,7 @@ discard block |
||
1909 | 1909 | * |
1910 | 1910 | * @return $this |
1911 | 1911 | */ |
1912 | - public function protectCells(AddressRange|CellAddress|int|string|array $range, string $password = '', bool $alreadyHashed = false, string $name = '', string $securityDescriptor = ''): static |
|
1912 | + public function protectCells(AddressRange | CellAddress | int | string | array $range, string $password = '', bool $alreadyHashed = false, string $name = '', string $securityDescriptor = ''): static |
|
1913 | 1913 | { |
1914 | 1914 | $range = Functions::trimSheetFromCellReference(Validations::validateCellOrCellRange($range)); |
1915 | 1915 | |
@@ -1930,7 +1930,7 @@ discard block |
||
1930 | 1930 | * |
1931 | 1931 | * @return $this |
1932 | 1932 | */ |
1933 | - public function unprotectCells(AddressRange|CellAddress|int|string|array $range): static |
|
1933 | + public function unprotectCells(AddressRange | CellAddress | int | string | array $range): static |
|
1934 | 1934 | { |
1935 | 1935 | $range = Functions::trimSheetFromCellReference(Validations::validateCellOrCellRange($range)); |
1936 | 1936 | |
@@ -1971,7 +1971,7 @@ discard block |
||
1971 | 1971 | * |
1972 | 1972 | * @return $this |
1973 | 1973 | */ |
1974 | - public function setAutoFilter(AddressRange|string|array|AutoFilter $autoFilterOrRange): static |
|
1974 | + public function setAutoFilter(AddressRange | string | array | AutoFilter $autoFilterOrRange): static |
|
1975 | 1975 | { |
1976 | 1976 | if (is_object($autoFilterOrRange) && ($autoFilterOrRange instanceof AutoFilter)) { |
1977 | 1977 | $this->autoFilter = $autoFilterOrRange; |
@@ -2116,7 +2116,7 @@ discard block |
||
2116 | 2116 | * |
2117 | 2117 | * @return $this |
2118 | 2118 | */ |
2119 | - public function freezePane(null|CellAddress|string|array $coordinate, null|CellAddress|string|array $topLeftCell = null, bool $frozenSplit = false): static |
|
2119 | + public function freezePane(null | CellAddress | string | array $coordinate, null | CellAddress | string | array $topLeftCell = null, bool $frozenSplit = false): static |
|
2120 | 2120 | { |
2121 | 2121 | $this->panes = [ |
2122 | 2122 | 'bottomRight' => null, |
@@ -2626,7 +2626,7 @@ discard block |
||
2626 | 2626 | * |
2627 | 2627 | * @return $this |
2628 | 2628 | */ |
2629 | - public function removeComment(CellAddress|string|array $cellCoordinate): self |
|
2629 | + public function removeComment(CellAddress | string | array $cellCoordinate): self |
|
2630 | 2630 | { |
2631 | 2631 | $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($cellCoordinate)); |
2632 | 2632 | |
@@ -2651,7 +2651,7 @@ discard block |
||
2651 | 2651 | * @param array{0: int, 1: int}|CellAddress|string $cellCoordinate Coordinate of the cell as a string, eg: 'C5'; |
2652 | 2652 | * or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object. |
2653 | 2653 | */ |
2654 | - public function getComment(CellAddress|string|array $cellCoordinate, bool $attachNew = true): Comment |
|
2654 | + public function getComment(CellAddress | string | array $cellCoordinate, bool $attachNew = true): Comment |
|
2655 | 2655 | { |
2656 | 2656 | $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($cellCoordinate)); |
2657 | 2657 | |
@@ -2716,7 +2716,7 @@ discard block |
||
2716 | 2716 | * |
2717 | 2717 | * @return $this |
2718 | 2718 | */ |
2719 | - public function setSelectedCells(AddressRange|CellAddress|int|string|array $coordinate): static |
|
2719 | + public function setSelectedCells(AddressRange | CellAddress | int | string | array $coordinate): static |
|
2720 | 2720 | { |
2721 | 2721 | if (is_string($coordinate)) { |
2722 | 2722 | $coordinate = Validations::definedNameToCoordinate($coordinate, $this); |
@@ -3186,7 +3186,7 @@ discard block |
||
3186 | 3186 | * |
3187 | 3187 | * @return ($range is non-empty-string ? ($returnRange is true ? array{0: string, 1: string} : string) : ($returnRange is true ? array{0: null, 1: null} : null)) |
3188 | 3188 | */ |
3189 | - public static function extractSheetTitle(?string $range, bool $returnRange = false, bool $unapostrophize = false): array|null|string |
|
3189 | + public static function extractSheetTitle(?string $range, bool $returnRange = false, bool $unapostrophize = false): array | null | string |
|
3190 | 3190 | { |
3191 | 3191 | if (empty($range)) { |
3192 | 3192 | return $returnRange ? [null, null] : null; |
@@ -12,7 +12,7 @@ |
||
12 | 12 | class CsvTest extends TestCase |
13 | 13 | { |
14 | 14 | #[DataProvider('providerDelimiterDetection')] |
15 | - public function testDelimiterDetection(string $filename, string $expectedDelimiter, string $cell, string|float|int|null $expectedValue): void |
|
15 | + public function testDelimiterDetection(string $filename, string $expectedDelimiter, string $cell, string | float | int | null $expectedValue): void |
|
16 | 16 | { |
17 | 17 | $reader = new Csv(); |
18 | 18 | $delim1 = $reader->getDelimiter(); |