@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | parent::__construct('complexAssert'); //* @phpstan-ignore-line |
20 | 20 | } |
21 | 21 | |
22 | - private function testExpectedExceptions(string|float $expected, string|float $actual): bool |
|
22 | + private function testExpectedExceptions(string | float $expected, string | float $actual): bool |
|
23 | 23 | { |
24 | 24 | // Expecting an error, so we do a straight string comparison |
25 | 25 | if ($expected === $actual) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | return $this->errorMessage; |
92 | 92 | } |
93 | 93 | |
94 | - public function runAssertComplexEquals(string $expected, array|float|string $actual, ?float $delta = null): void |
|
94 | + public function runAssertComplexEquals(string $expected, array | float | string $actual, ?float $delta = null): void |
|
95 | 95 | { |
96 | 96 | self::assertTrue($this->assertComplexEquals($expected, $actual, $delta), $this->getErrorMessage()); |
97 | 97 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | #[DataProvider('providerTimeOnly')] |
42 | - public function testTimeOnly(int|float $expectedResult, int|float|string $value, ?string $format = null): void |
|
42 | + public function testTimeOnly(int | float $expectedResult, int | float | string $value, ?string $format = null): void |
|
43 | 43 | { |
44 | 44 | Cell::setCalculateDateTimeType(Cell::CALCULATE_TIME_FLOAT); |
45 | 45 | $spreadsheet = $this->spreadsheet = new Spreadsheet(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | #[DataProvider('providerDateAndTime')] |
87 | - public function testDateAndTime(int|float $expectedResult, int|float|string $value, ?string $format = null): void |
|
87 | + public function testDateAndTime(int | float $expectedResult, int | float | string $value, ?string $format = null): void |
|
88 | 88 | { |
89 | 89 | Cell::setCalculateDateTimeType( |
90 | 90 | Cell::CALCULATE_DATE_TIME_FLOAT |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | #[DataProvider('providerAsis')] |
134 | - public function testDefault(int|float $expectedResult, int|float|string $value, ?string $format = null): void |
|
134 | + public function testDefault(int | float $expectedResult, int | float | string $value, ?string $format = null): void |
|
135 | 135 | { |
136 | 136 | $spreadsheet = $this->spreadsheet = new Spreadsheet(); |
137 | 137 | self::assertSame(0, $spreadsheet->getActiveSheetIndex()); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | |
154 | 154 | #[DataProvider('providerAsis')] |
155 | - public function testAsis(int|float $expectedResult, int|float|string $value, ?string $format = null): void |
|
155 | + public function testAsis(int | float $expectedResult, int | float | string $value, ?string $format = null): void |
|
156 | 156 | { |
157 | 157 | Cell::setCalculateDateTimeType( |
158 | 158 | Cell::CALCULATE_DATE_TIME_ASIS |
@@ -2070,13 +2070,13 @@ discard block |
||
2070 | 2070 | } |
2071 | 2071 | |
2072 | 2072 | /** @param null|bool|mixed[]|SimpleXMLElement $array */ |
2073 | - private static function getArrayItem(null|array|bool|SimpleXMLElement $array, int|string $key = 0): mixed |
|
2073 | + private static function getArrayItem(null | array | bool | SimpleXMLElement $array, int | string $key = 0): mixed |
|
2074 | 2074 | { |
2075 | 2075 | return ($array === null || is_bool($array)) ? null : ($array[$key] ?? null); |
2076 | 2076 | } |
2077 | 2077 | |
2078 | 2078 | /** @param null|bool|mixed[]|SimpleXMLElement $array */ |
2079 | - private static function getArrayItemString(null|array|bool|SimpleXMLElement $array, int|string $key = 0): string |
|
2079 | + private static function getArrayItemString(null | array | bool | SimpleXMLElement $array, int | string $key = 0): string |
|
2080 | 2080 | { |
2081 | 2081 | $retVal = self::getArrayItem($array, $key); |
2082 | 2082 | |
@@ -2084,14 +2084,14 @@ discard block |
||
2084 | 2084 | } |
2085 | 2085 | |
2086 | 2086 | /** @param null|bool|mixed[]|SimpleXMLElement $array */ |
2087 | - private static function getArrayItemIntOrSxml(null|array|bool|SimpleXMLElement $array, int|string $key = 0): int|SimpleXMLElement |
|
2087 | + private static function getArrayItemIntOrSxml(null | array | bool | SimpleXMLElement $array, int | string $key = 0): int | SimpleXMLElement |
|
2088 | 2088 | { |
2089 | 2089 | $retVal = self::getArrayItem($array, $key); |
2090 | 2090 | |
2091 | 2091 | return (is_int($retVal) || $retVal instanceof SimpleXMLElement) ? $retVal : 0; |
2092 | 2092 | } |
2093 | 2093 | |
2094 | - private static function dirAdd(null|SimpleXMLElement|string $base, null|SimpleXMLElement|string $add): string |
|
2094 | + private static function dirAdd(null | SimpleXMLElement | string $base, null | SimpleXMLElement | string $add): string |
|
2095 | 2095 | { |
2096 | 2096 | $base = (string) $base; |
2097 | 2097 | $add = (string) $add; |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | * |
263 | 263 | * @param-out string $cellContent In one case, it can be bool |
264 | 264 | */ |
265 | - protected function flushCell(Worksheet $sheet, string $column, int|string $row, mixed &$cellContent, array $attributeArray): void |
|
265 | + protected function flushCell(Worksheet $sheet, string $column, int | string $row, mixed &$cellContent, array $attributeArray): void |
|
266 | 266 | { |
267 | 267 | if (is_string($cellContent)) { |
268 | 268 | // Simple String content |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | /** @var array<int, array<int, string>> */ |
313 | 313 | private static array $falseTrueArray = []; |
314 | 314 | |
315 | - private static function convertBoolean(?string $cellContent): bool|string |
|
315 | + private static function convertBoolean(?string $cellContent): bool | string |
|
316 | 316 | { |
317 | 317 | if ($cellContent === '1') { |
318 | 318 | return true; |
@@ -919,7 +919,7 @@ discard block |
||
919 | 919 | * |
920 | 920 | * @param string[] $attributeArray |
921 | 921 | */ |
922 | - private function applyInlineStyle(Worksheet &$sheet, int $row, string $column, array $attributeArray): void |
|
922 | + private function applyInlineStyle(Worksheet & $sheet, int $row, string $column, array $attributeArray): void |
|
923 | 923 | { |
924 | 924 | if (!isset($attributeArray['style'])) { |
925 | 925 | return; |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | { |
299 | 299 | }*/ |
300 | 300 | |
301 | - private function readCFFormula(string $recordData, int $offset, int $size, Xls $xls): float|int|string|null |
|
301 | + private function readCFFormula(string $recordData, int $offset, int $size, Xls $xls): float | int | string | null |
|
302 | 302 | { |
303 | 303 | try { |
304 | 304 | $formula = substr($recordData, $offset, $size); |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | } |
317 | 317 | |
318 | 318 | /** @param string[] $cellRanges */ |
319 | - private function setCFRules(array $cellRanges, string $type, string $operator, null|float|int|string $formula1, null|float|int|string $formula2, Style $style, bool $noFormatSet, Xls $xls): void |
|
319 | + private function setCFRules(array $cellRanges, string $type, string $operator, null | float | int | string $formula1, null | float | int | string $formula2, Style $style, bool $noFormatSet, Xls $xls): void |
|
320 | 320 | { |
321 | 321 | foreach ($cellRanges as $cellRange) { |
322 | 322 | $conditional = new Conditional(); |
@@ -309,7 +309,7 @@ |
||
309 | 309 | return $dataBar; |
310 | 310 | } |
311 | 311 | |
312 | - private function readColorScale(SimpleXMLElement|stdClass $cfRule): ConditionalColorScale |
|
312 | + private function readColorScale(SimpleXMLElement | stdClass $cfRule): ConditionalColorScale |
|
313 | 313 | { |
314 | 314 | $colorScale = new ConditionalColorScale(); |
315 | 315 | /** @var SimpleXMLElement $cfRule */ |
@@ -91,7 +91,7 @@ |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | /** @param null|false|scalar[] $array */ |
94 | - private function getArrayItem(null|array|false $array): string |
|
94 | + private function getArrayItem(null | array | false $array): string |
|
95 | 95 | { |
96 | 96 | return is_array($array) ? (string) ($array[0] ?? '') : ''; |
97 | 97 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | /** @return array{type: ?string, value: ?string, alpha: ?int} */ |
181 | - protected function setColorProperties(?string $color, null|float|int|string $alpha, ?string $colorType): array |
|
181 | + protected function setColorProperties(?string $color, null | float | int | string $alpha, ?string $colorType): array |
|
182 | 182 | { |
183 | 183 | return [ |
184 | 184 | 'type' => $colorType, |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | /** |
404 | 404 | * Get value of array element. |
405 | 405 | */ |
406 | - protected function getArrayElementsValue(array $properties, array|int|string $elements): mixed |
|
406 | + protected function getArrayElementsValue(array $properties, array | int | string $elements): mixed |
|
407 | 407 | { |
408 | 408 | $reference = &$properties; |
409 | 409 | if (!is_array($elements)) { |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | /** |
438 | 438 | * Get Glow Property. |
439 | 439 | */ |
440 | - public function getGlowProperty(array|string $property): null|array|float|int|string |
|
440 | + public function getGlowProperty(array | string $property): null | array | float | int | string |
|
441 | 441 | { |
442 | 442 | $retVal = null; |
443 | 443 | if ($property === 'size') { |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | /** |
459 | 459 | * Get Glow Color Property. |
460 | 460 | */ |
461 | - public function getGlowColor(string $propertyName): null|int|string |
|
461 | + public function getGlowColor(string $propertyName): null | int | string |
|
462 | 462 | { |
463 | 463 | return $this->glowColor->getColorProperty($propertyName); |
464 | 464 | } |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | /** |
526 | 526 | * Set Shadow Properties. |
527 | 527 | */ |
528 | - public function setShadowProperties(int $presets, ?string $colorValue = null, ?string $colorType = null, null|float|int|string $colorAlpha = null, ?float $blur = null, ?int $angle = null, ?float $distance = null): void |
|
528 | + public function setShadowProperties(int $presets, ?string $colorValue = null, ?string $colorType = null, null | float | int | string $colorAlpha = null, ?float $blur = null, ?int $angle = null, ?float $distance = null): void |
|
529 | 529 | { |
530 | 530 | $this->activateObject()->setShadowPresetsProperties((int) $presets); |
531 | 531 | if ($presets === 0) { |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | * |
609 | 609 | * @return $this |
610 | 610 | */ |
611 | - protected function setShadowAngle(null|float|int|string $angle) |
|
611 | + protected function setShadowAngle(null | float | int | string $angle) |
|
612 | 612 | { |
613 | 613 | if (is_numeric($angle)) { |
614 | 614 | $this->shadowProperties['direction'] = $angle; |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | * |
642 | 642 | * @param string|string[] $elements |
643 | 643 | */ |
644 | - public function getShadowProperty($elements): array|string|null |
|
644 | + public function getShadowProperty($elements): array | string | null |
|
645 | 645 | { |
646 | 646 | if ($elements === 'color') { |
647 | 647 | return [ |
@@ -729,7 +729,7 @@ discard block |
||
729 | 729 | /** |
730 | 730 | * Get Line Color Property. |
731 | 731 | */ |
732 | - public function getLineColorProperty(string $propertyName): null|int|string |
|
732 | + public function getLineColorProperty(string $propertyName): null | int | string |
|
733 | 733 | { |
734 | 734 | return $this->lineColor->getColorProperty($propertyName); |
735 | 735 | } |
@@ -738,7 +738,7 @@ discard block |
||
738 | 738 | * Set Line Style Properties. |
739 | 739 | */ |
740 | 740 | public function setLineStyleProperties( |
741 | - null|float|int|string $lineWidth = null, |
|
741 | + null | float | int | string $lineWidth = null, |
|
742 | 742 | ?string $compoundType = '', |
743 | 743 | ?string $dashType = '', |
744 | 744 | ?string $capType = '', |
@@ -834,7 +834,7 @@ discard block |
||
834 | 834 | /** |
835 | 835 | * Get Line Style Property. |
836 | 836 | */ |
837 | - public function getLineStyleProperty(array|string $elements): ?string |
|
837 | + public function getLineStyleProperty(array | string $elements): ?string |
|
838 | 838 | { |
839 | 839 | $retVal = $this->getArrayElementsValue($this->lineStyleProperties, $elements); |
840 | 840 | if (is_scalar($retVal)) { |
@@ -69,7 +69,7 @@ |
||
69 | 69 | * |
70 | 70 | * @var null|array<string, mixed[]> |
71 | 71 | */ |
72 | - private static ?array $cachedStyles = null; |
|
72 | + private static ? array $cachedStyles = null; |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * Create a new Style. |