@@ -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)"); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * All other dates must be later than this date, but they may occur in any order |
31 | 31 | * @param mixed $guess An optional guess at the expected answer |
32 | 32 | */ |
33 | - public static function rate(mixed $values, mixed $dates, mixed $guess = self::DEFAULT_GUESS): float|string |
|
33 | + public static function rate(mixed $values, mixed $dates, mixed $guess = self::DEFAULT_GUESS): float | string |
|
34 | 34 | { |
35 | 35 | $rslt = self::xirrPart1($values, $dates); |
36 | 36 | if ($rslt !== '') { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * The first payment date indicates the beginning of the schedule of payments. |
118 | 118 | * All other dates must be later than this date, but they may occur in any order. |
119 | 119 | */ |
120 | - public static function presentValue(mixed $rate, mixed $values, mixed $dates): float|string |
|
120 | + public static function presentValue(mixed $rate, mixed $values, mixed $dates): float | string |
|
121 | 121 | { |
122 | 122 | return self::xnpvOrdered($rate, $values, $dates, true); |
123 | 123 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | return ''; |
175 | 175 | } |
176 | 176 | |
177 | - private static function xirrPart3(array $values, array $dates, float $x1, float $x2): float|string |
|
177 | + private static function xirrPart3(array $values, array $dates, float $x1, float $x2): float | string |
|
178 | 178 | { |
179 | 179 | $f = self::xnpvOrdered($x1, $values, $dates, false); |
180 | 180 | if ($f < 0.0) { |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | return $rslt; |
204 | 204 | } |
205 | 205 | |
206 | - private static function xirrBisection(array $values, array $dates, float $x1, float $x2): string|float |
|
206 | + private static function xirrBisection(array $values, array $dates, float $x1, float $x2): string | float |
|
207 | 207 | { |
208 | 208 | $rslt = ExcelError::NAN(); |
209 | 209 | for ($i = 0; $i < self::FINANCIAL_MAX_ITERATIONS; ++$i) { |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | } |
241 | 241 | |
242 | 242 | /** @param array<int,float|int|numeric-string> $values> */ |
243 | - private static function xnpvOrdered(mixed $rate, mixed $values, mixed $dates, bool $ordered = true, bool $capAtNegative1 = false): float|string |
|
243 | + private static function xnpvOrdered(mixed $rate, mixed $values, mixed $dates, bool $ordered = true, bool $capAtNegative1 = false): float | string |
|
244 | 244 | { |
245 | 245 | $rate = Functions::flattenSingleValue($rate); |
246 | 246 | $values = Functions::flattenArray($values); |
@@ -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); |
@@ -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 | $cellCoordinate = Validations::validateCellOrCellRange($cellCoordinate); |
1399 | 1399 | |
@@ -1635,7 +1635,7 @@ discard block |
||
1635 | 1635 | * |
1636 | 1636 | * @return $this |
1637 | 1637 | */ |
1638 | - public function setBreak(CellAddress|string|array $coordinate, int $break, int $max = -1): static |
|
1638 | + public function setBreak(CellAddress | string | array $coordinate, int $break, int $max = -1): static |
|
1639 | 1639 | { |
1640 | 1640 | $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($coordinate)); |
1641 | 1641 | |
@@ -1732,7 +1732,7 @@ discard block |
||
1732 | 1732 | * |
1733 | 1733 | * @return $this |
1734 | 1734 | */ |
1735 | - public function mergeCells(AddressRange|string|array $range, string $behaviour = self::MERGE_CELL_CONTENT_EMPTY): static |
|
1735 | + public function mergeCells(AddressRange | string | array $range, string $behaviour = self::MERGE_CELL_CONTENT_EMPTY): static |
|
1736 | 1736 | { |
1737 | 1737 | $range = Functions::trimSheetFromCellReference(Validations::validateCellRange($range)); |
1738 | 1738 | |
@@ -1852,7 +1852,7 @@ discard block |
||
1852 | 1852 | * |
1853 | 1853 | * @return $this |
1854 | 1854 | */ |
1855 | - public function unmergeCells(AddressRange|string|array $range): static |
|
1855 | + public function unmergeCells(AddressRange | string | array $range): static |
|
1856 | 1856 | { |
1857 | 1857 | $range = Functions::trimSheetFromCellReference(Validations::validateCellRange($range)); |
1858 | 1858 | |
@@ -1905,7 +1905,7 @@ discard block |
||
1905 | 1905 | * |
1906 | 1906 | * @return $this |
1907 | 1907 | */ |
1908 | - public function protectCells(AddressRange|CellAddress|int|string|array $range, string $password = '', bool $alreadyHashed = false, string $name = '', string $securityDescriptor = ''): static |
|
1908 | + public function protectCells(AddressRange | CellAddress | int | string | array $range, string $password = '', bool $alreadyHashed = false, string $name = '', string $securityDescriptor = ''): static |
|
1909 | 1909 | { |
1910 | 1910 | $range = Functions::trimSheetFromCellReference(Validations::validateCellOrCellRange($range)); |
1911 | 1911 | |
@@ -1926,7 +1926,7 @@ discard block |
||
1926 | 1926 | * |
1927 | 1927 | * @return $this |
1928 | 1928 | */ |
1929 | - public function unprotectCells(AddressRange|CellAddress|int|string|array $range): static |
|
1929 | + public function unprotectCells(AddressRange | CellAddress | int | string | array $range): static |
|
1930 | 1930 | { |
1931 | 1931 | $range = Functions::trimSheetFromCellReference(Validations::validateCellOrCellRange($range)); |
1932 | 1932 | |
@@ -1967,7 +1967,7 @@ discard block |
||
1967 | 1967 | * |
1968 | 1968 | * @return $this |
1969 | 1969 | */ |
1970 | - public function setAutoFilter(AddressRange|string|array|AutoFilter $autoFilterOrRange): static |
|
1970 | + public function setAutoFilter(AddressRange | string | array | AutoFilter $autoFilterOrRange): static |
|
1971 | 1971 | { |
1972 | 1972 | if (is_object($autoFilterOrRange) && ($autoFilterOrRange instanceof AutoFilter)) { |
1973 | 1973 | $this->autoFilter = $autoFilterOrRange; |
@@ -2112,7 +2112,7 @@ discard block |
||
2112 | 2112 | * |
2113 | 2113 | * @return $this |
2114 | 2114 | */ |
2115 | - public function freezePane(null|CellAddress|string|array $coordinate, null|CellAddress|string|array $topLeftCell = null, bool $frozenSplit = false): static |
|
2115 | + public function freezePane(null | CellAddress | string | array $coordinate, null | CellAddress | string | array $topLeftCell = null, bool $frozenSplit = false): static |
|
2116 | 2116 | { |
2117 | 2117 | $this->panes = [ |
2118 | 2118 | 'bottomRight' => null, |
@@ -2622,7 +2622,7 @@ discard block |
||
2622 | 2622 | * |
2623 | 2623 | * @return $this |
2624 | 2624 | */ |
2625 | - public function removeComment(CellAddress|string|array $cellCoordinate): self |
|
2625 | + public function removeComment(CellAddress | string | array $cellCoordinate): self |
|
2626 | 2626 | { |
2627 | 2627 | $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($cellCoordinate)); |
2628 | 2628 | |
@@ -2647,7 +2647,7 @@ discard block |
||
2647 | 2647 | * @param array{0: int, 1: int}|CellAddress|string $cellCoordinate Coordinate of the cell as a string, eg: 'C5'; |
2648 | 2648 | * or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object. |
2649 | 2649 | */ |
2650 | - public function getComment(CellAddress|string|array $cellCoordinate, bool $attachNew = true): Comment |
|
2650 | + public function getComment(CellAddress | string | array $cellCoordinate, bool $attachNew = true): Comment |
|
2651 | 2651 | { |
2652 | 2652 | $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($cellCoordinate)); |
2653 | 2653 | |
@@ -2712,7 +2712,7 @@ discard block |
||
2712 | 2712 | * |
2713 | 2713 | * @return $this |
2714 | 2714 | */ |
2715 | - public function setSelectedCells(AddressRange|CellAddress|int|string|array $coordinate): static |
|
2715 | + public function setSelectedCells(AddressRange | CellAddress | int | string | array $coordinate): static |
|
2716 | 2716 | { |
2717 | 2717 | if (is_string($coordinate)) { |
2718 | 2718 | $coordinate = Validations::definedNameToCoordinate($coordinate, $this); |
@@ -3182,7 +3182,7 @@ discard block |
||
3182 | 3182 | * |
3183 | 3183 | * @return ($range is non-empty-string ? ($returnRange is true ? array{0: string, 1: string} : string) : ($returnRange is true ? array{0: null, 1: null} : null)) |
3184 | 3184 | */ |
3185 | - public static function extractSheetTitle(?string $range, bool $returnRange = false, bool $unapostrophize = false): array|null|string |
|
3185 | + public static function extractSheetTitle(?string $range, bool $returnRange = false, bool $unapostrophize = false): array | null | string |
|
3186 | 3186 | { |
3187 | 3187 | if (empty($range)) { |
3188 | 3188 | return $returnRange ? [null, null] : null; |