@@ -180,7 +180,7 @@ |
||
180 | 180 | /** |
181 | 181 | * @dataProvider providerAbsoluteReferences |
182 | 182 | */ |
183 | - public function testAbsoluteReferenceFromString(mixed $expectedResult, int|string $rangeSet): void |
|
183 | + public function testAbsoluteReferenceFromString(mixed $expectedResult, int | string $rangeSet): void |
|
184 | 184 | { |
185 | 185 | $result = Coordinate::absoluteReference((string) $rangeSet); |
186 | 186 | self::assertEquals($expectedResult, $result); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * |
16 | 16 | * @param string|string[] $expectedResult |
17 | 17 | */ |
18 | - public function testCodePageNumberToName(array|string $expectedResult, int $codePageIndex): void |
|
18 | + public function testCodePageNumberToName(array | string $expectedResult, int $codePageIndex): void |
|
19 | 19 | { |
20 | 20 | if ($expectedResult === 'exception') { |
21 | 21 | $this->expectException(Exception::class); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | /** |
45 | 45 | * @dataProvider providerFontSizeToPixels |
46 | 46 | */ |
47 | - public function testFontSizeToPixels(float|int $expectedResult, float|int $size): void |
|
47 | + public function testFontSizeToPixels(float | int $expectedResult, float | int $size): void |
|
48 | 48 | { |
49 | 49 | $result = Font::fontSizeToPixels($size); |
50 | 50 | self::assertEquals($expectedResult, $result); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | /** |
59 | 59 | * @dataProvider providerInchSizeToPixels |
60 | 60 | */ |
61 | - public function testInchSizeToPixels(float|int $expectedResult, float|int $size): void |
|
61 | + public function testInchSizeToPixels(float | int $expectedResult, float | int $size): void |
|
62 | 62 | { |
63 | 63 | $result = Font::inchSizeToPixels($size); |
64 | 64 | self::assertEqualsWithDelta($expectedResult, $result, self::FONT_PRECISION); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * If an array of numbers is passed as an argument, then the returned result will also be an array |
30 | 30 | * with the same dimensions |
31 | 31 | */ |
32 | - public static function DELTA(array|float|bool|string|int $a, array|float|bool|string|int $b = 0.0): array|string|int |
|
32 | + public static function DELTA(array | float | bool | string | int $a, array | float | bool | string | int $b = 0.0): array | string | int |
|
33 | 33 | { |
34 | 34 | if (is_array($a) || is_array($b)) { |
35 | 35 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $a, $b); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * If an array of numbers is passed as an argument, then the returned result will also be an array |
65 | 65 | * with the same dimensions |
66 | 66 | */ |
67 | - public static function GESTEP(array|float|bool|string|int $number, $step = 0.0): array|string|int |
|
67 | + public static function GESTEP(array | float | bool | string | int $number, $step = 0.0): array | string | int |
|
68 | 68 | { |
69 | 69 | if (is_array($number) || is_array($step)) { |
70 | 70 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $step); |
@@ -329,12 +329,12 @@ discard block |
||
329 | 329 | /** |
330 | 330 | * Pad amount for exact in pixels; use best guess if null. |
331 | 331 | */ |
332 | - private static null|float|int $paddingAmountExact = null; |
|
332 | + private static null | float | int $paddingAmountExact = null; |
|
333 | 333 | |
334 | 334 | /** |
335 | 335 | * Set pad amount for exact in pixels; use best guess if null. |
336 | 336 | */ |
337 | - public static function setPaddingAmountExact(null|float|int $paddingAmountExact): void |
|
337 | + public static function setPaddingAmountExact(null | float | int $paddingAmountExact): void |
|
338 | 338 | { |
339 | 339 | self::$paddingAmountExact = $paddingAmountExact; |
340 | 340 | } |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | /** |
343 | 343 | * Get pad amount for exact in pixels; or null if using best guess. |
344 | 344 | */ |
345 | - public static function getPaddingAmountExact(): null|float|int |
|
345 | + public static function getPaddingAmountExact(): null | float | int |
|
346 | 346 | { |
347 | 347 | return self::$paddingAmountExact; |
348 | 348 | } |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | * |
504 | 504 | * @return int Font size (in pixels) |
505 | 505 | */ |
506 | - public static function fontSizeToPixels(float|int $fontSizeInPoints): int |
|
506 | + public static function fontSizeToPixels(float | int $fontSizeInPoints): int |
|
507 | 507 | { |
508 | 508 | return (int) ((4 / 3) * $fontSizeInPoints); |
509 | 509 | } |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | * |
516 | 516 | * @return float|int Size (in pixels) |
517 | 517 | */ |
518 | - public static function inchSizeToPixels(int|float $sizeInInch): int|float |
|
518 | + public static function inchSizeToPixels(int | float $sizeInInch): int | float |
|
519 | 519 | { |
520 | 520 | return $sizeInInch * 96; |
521 | 521 | } |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | * |
528 | 528 | * @return float Size (in pixels) |
529 | 529 | */ |
530 | - public static function centimeterSizeToPixels(int|float $sizeInCm): float |
|
530 | + public static function centimeterSizeToPixels(int | float $sizeInCm): float |
|
531 | 531 | { |
532 | 532 | return $sizeInCm * 37.795275591; |
533 | 533 | } |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | * |
629 | 629 | * @return ($returnAsPixels is true ? int : float) Column width |
630 | 630 | */ |
631 | - public static function getDefaultColumnWidthByFont(FontStyle $font, bool $returnAsPixels = false): float|int |
|
631 | + public static function getDefaultColumnWidthByFont(FontStyle $font, bool $returnAsPixels = false): float | int |
|
632 | 632 | { |
633 | 633 | if (isset(self::DEFAULT_COLUMN_WIDTHS[$font->getName()][$font->getSize()])) { |
634 | 634 | // Exact width can be determined |
@@ -91,7 +91,7 @@ |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
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 | } |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | /** |
37 | 37 | * Created. |
38 | 38 | */ |
39 | - private float|int $created; |
|
39 | + private float | int $created; |
|
40 | 40 | |
41 | 41 | /** |
42 | 42 | * Modified. |
43 | 43 | */ |
44 | - private float|int $modified; |
|
44 | + private float | int $modified; |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * Title. |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | return $this; |
141 | 141 | } |
142 | 142 | |
143 | - private static function intOrFloatTimestamp(null|float|int|string $timestamp): float|int |
|
143 | + private static function intOrFloatTimestamp(null | float | int | string $timestamp): float | int |
|
144 | 144 | { |
145 | 145 | if ($timestamp === null) { |
146 | 146 | $timestamp = (float) (new DateTime())->format('U'); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | /** |
162 | 162 | * Get Created. |
163 | 163 | */ |
164 | - public function getCreated(): float|int |
|
164 | + public function getCreated(): float | int |
|
165 | 165 | { |
166 | 166 | return $this->created; |
167 | 167 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * |
172 | 172 | * @return $this |
173 | 173 | */ |
174 | - public function setCreated(null|float|int|string $timestamp): self |
|
174 | + public function setCreated(null | float | int | string $timestamp): self |
|
175 | 175 | { |
176 | 176 | $this->created = self::intOrFloatTimestamp($timestamp); |
177 | 177 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | /** |
182 | 182 | * Get Modified. |
183 | 183 | */ |
184 | - public function getModified(): float|int |
|
184 | + public function getModified(): float | int |
|
185 | 185 | { |
186 | 186 | return $this->modified; |
187 | 187 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | * |
192 | 192 | * @return $this |
193 | 193 | */ |
194 | - public function setModified(null|float|int|string $timestamp): self |
|
194 | + public function setModified(null | float | int | string $timestamp): self |
|
195 | 195 | { |
196 | 196 | $this->modified = self::intOrFloatTimestamp($timestamp); |
197 | 197 | |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | /** |
360 | 360 | * Get a Custom Property Value. |
361 | 361 | */ |
362 | - public function getCustomPropertyValue(string $propertyName): bool|int|float|string|null |
|
362 | + public function getCustomPropertyValue(string $propertyName): bool | int | float | string | null |
|
363 | 363 | { |
364 | 364 | if (isset($this->customProperties[$propertyName])) { |
365 | 365 | return $this->customProperties[$propertyName]['value']; |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | return $this->customProperties[$propertyName]['type'] ?? null; |
377 | 377 | } |
378 | 378 | |
379 | - private function identifyPropertyType(bool|int|float|string|null $propertyValue): string |
|
379 | + private function identifyPropertyType(bool | int | float | string | null $propertyValue): string |
|
380 | 380 | { |
381 | 381 | if (is_float($propertyValue)) { |
382 | 382 | return self::PROPERTY_TYPE_FLOAT; |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | * |
399 | 399 | * @return $this |
400 | 400 | */ |
401 | - public function setCustomProperty(string $propertyName, bool|int|float|string|null $propertyValue = '', ?string $propertyType = null): self |
|
401 | + public function setCustomProperty(string $propertyName, bool | int | float | string | null $propertyValue = '', ?string $propertyType = null): self |
|
402 | 402 | { |
403 | 403 | if (($propertyType === null) || (!in_array($propertyType, self::VALID_PROPERTY_TYPE_LIST))) { |
404 | 404 | $propertyType = $this->identifyPropertyType($propertyValue); |
@@ -415,32 +415,32 @@ discard block |
||
415 | 415 | } |
416 | 416 | |
417 | 417 | private const PROPERTY_TYPE_ARRAY = [ |
418 | - 'i' => self::PROPERTY_TYPE_INTEGER, // Integer |
|
419 | - 'i1' => self::PROPERTY_TYPE_INTEGER, // 1-Byte Signed Integer |
|
420 | - 'i2' => self::PROPERTY_TYPE_INTEGER, // 2-Byte Signed Integer |
|
421 | - 'i4' => self::PROPERTY_TYPE_INTEGER, // 4-Byte Signed Integer |
|
422 | - 'i8' => self::PROPERTY_TYPE_INTEGER, // 8-Byte Signed Integer |
|
423 | - 'int' => self::PROPERTY_TYPE_INTEGER, // Integer |
|
424 | - 'ui1' => self::PROPERTY_TYPE_INTEGER, // 1-Byte Unsigned Integer |
|
425 | - 'ui2' => self::PROPERTY_TYPE_INTEGER, // 2-Byte Unsigned Integer |
|
426 | - 'ui4' => self::PROPERTY_TYPE_INTEGER, // 4-Byte Unsigned Integer |
|
427 | - 'ui8' => self::PROPERTY_TYPE_INTEGER, // 8-Byte Unsigned Integer |
|
428 | - 'uint' => self::PROPERTY_TYPE_INTEGER, // Unsigned Integer |
|
429 | - 'f' => self::PROPERTY_TYPE_FLOAT, // Real Number |
|
430 | - 'r4' => self::PROPERTY_TYPE_FLOAT, // 4-Byte Real Number |
|
431 | - 'r8' => self::PROPERTY_TYPE_FLOAT, // 8-Byte Real Number |
|
432 | - 'decimal' => self::PROPERTY_TYPE_FLOAT, // Decimal |
|
433 | - 's' => self::PROPERTY_TYPE_STRING, // String |
|
434 | - 'empty' => self::PROPERTY_TYPE_STRING, // Empty |
|
435 | - 'null' => self::PROPERTY_TYPE_STRING, // Null |
|
436 | - 'lpstr' => self::PROPERTY_TYPE_STRING, // LPSTR |
|
437 | - 'lpwstr' => self::PROPERTY_TYPE_STRING, // LPWSTR |
|
438 | - 'bstr' => self::PROPERTY_TYPE_STRING, // Basic String |
|
439 | - 'd' => self::PROPERTY_TYPE_DATE, // Date and Time |
|
440 | - 'date' => self::PROPERTY_TYPE_DATE, // Date and Time |
|
441 | - 'filetime' => self::PROPERTY_TYPE_DATE, // File Time |
|
442 | - 'b' => self::PROPERTY_TYPE_BOOLEAN, // Boolean |
|
443 | - 'bool' => self::PROPERTY_TYPE_BOOLEAN, // Boolean |
|
418 | + 'i' => self::PROPERTY_TYPE_INTEGER, // Integer |
|
419 | + 'i1' => self::PROPERTY_TYPE_INTEGER, // 1-Byte Signed Integer |
|
420 | + 'i2' => self::PROPERTY_TYPE_INTEGER, // 2-Byte Signed Integer |
|
421 | + 'i4' => self::PROPERTY_TYPE_INTEGER, // 4-Byte Signed Integer |
|
422 | + 'i8' => self::PROPERTY_TYPE_INTEGER, // 8-Byte Signed Integer |
|
423 | + 'int' => self::PROPERTY_TYPE_INTEGER, // Integer |
|
424 | + 'ui1' => self::PROPERTY_TYPE_INTEGER, // 1-Byte Unsigned Integer |
|
425 | + 'ui2' => self::PROPERTY_TYPE_INTEGER, // 2-Byte Unsigned Integer |
|
426 | + 'ui4' => self::PROPERTY_TYPE_INTEGER, // 4-Byte Unsigned Integer |
|
427 | + 'ui8' => self::PROPERTY_TYPE_INTEGER, // 8-Byte Unsigned Integer |
|
428 | + 'uint' => self::PROPERTY_TYPE_INTEGER, // Unsigned Integer |
|
429 | + 'f' => self::PROPERTY_TYPE_FLOAT, // Real Number |
|
430 | + 'r4' => self::PROPERTY_TYPE_FLOAT, // 4-Byte Real Number |
|
431 | + 'r8' => self::PROPERTY_TYPE_FLOAT, // 8-Byte Real Number |
|
432 | + 'decimal' => self::PROPERTY_TYPE_FLOAT, // Decimal |
|
433 | + 's' => self::PROPERTY_TYPE_STRING, // String |
|
434 | + 'empty' => self::PROPERTY_TYPE_STRING, // Empty |
|
435 | + 'null' => self::PROPERTY_TYPE_STRING, // Null |
|
436 | + 'lpstr' => self::PROPERTY_TYPE_STRING, // LPSTR |
|
437 | + 'lpwstr' => self::PROPERTY_TYPE_STRING, // LPWSTR |
|
438 | + 'bstr' => self::PROPERTY_TYPE_STRING, // Basic String |
|
439 | + 'd' => self::PROPERTY_TYPE_DATE, // Date and Time |
|
440 | + 'date' => self::PROPERTY_TYPE_DATE, // Date and Time |
|
441 | + 'filetime' => self::PROPERTY_TYPE_DATE, // File Time |
|
442 | + 'b' => self::PROPERTY_TYPE_BOOLEAN, // Boolean |
|
443 | + 'bool' => self::PROPERTY_TYPE_BOOLEAN, // Boolean |
|
444 | 444 | ]; |
445 | 445 | |
446 | 446 | private const SPECIAL_TYPES = [ |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | /** |
452 | 452 | * Convert property to form desired by Excel. |
453 | 453 | */ |
454 | - public static function convertProperty(bool|int|float|string|null $propertyValue, string $propertyType): bool|int|float|string|null |
|
454 | + public static function convertProperty(bool | int | float | string | null $propertyValue, string $propertyType): bool | int | float | string | null |
|
455 | 455 | { |
456 | 456 | return self::SPECIAL_TYPES[$propertyType] ?? self::convertProperty2($propertyValue, $propertyType); |
457 | 457 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | /** |
460 | 460 | * Convert property to form desired by Excel. |
461 | 461 | */ |
462 | - private static function convertProperty2(bool|int|float|string|null $propertyValue, string $type): bool|int|float|string|null |
|
462 | + private static function convertProperty2(bool | int | float | string | null $propertyValue, string $type): bool | int | float | string | null |
|
463 | 463 | { |
464 | 464 | $propertyType = self::convertPropertyType($type); |
465 | 465 | switch ($propertyType) { |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | /** |
17 | 17 | * @dataProvider providerBITOR |
18 | 18 | */ |
19 | - public function testDirectCallToBITOR(float|int|string $expectedResult, null|bool|int|float|string $arg1, null|bool|int|float|string $arg2): void |
|
19 | + public function testDirectCallToBITOR(float | int | string $expectedResult, null | bool | int | float | string $arg1, null | bool | int | float | string $arg2): void |
|
20 | 20 | { |
21 | 21 | $result = BitWise::BITOR($arg1, $arg2); |
22 | 22 | self::assertSame($expectedResult, $result); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | /** |
26 | 26 | * @dataProvider providerBITOR |
27 | 27 | */ |
28 | - public function testBITORAsFormula(float|int|string $expectedResult, mixed ...$args): void |
|
28 | + public function testBITORAsFormula(float | int | string $expectedResult, mixed ...$args): void |
|
29 | 29 | { |
30 | 30 | $arguments = new FormulaArguments(...$args); |
31 | 31 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * @dataProvider providerBITOR |
41 | 41 | */ |
42 | - public function testBITORInWorksheet(float|int|string $expectedResult, mixed ...$args): void |
|
42 | + public function testBITORInWorksheet(float | int | string $expectedResult, mixed ...$args): void |
|
43 | 43 | { |
44 | 44 | $arguments = new FormulaArguments(...$args); |
45 | 45 |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | /** |
17 | 17 | * @dataProvider providerBITAND |
18 | 18 | */ |
19 | - public function testDirectCallToBITAND(float|int|string $expectedResult, null|bool|int|float|string $arg1, null|bool|int|float|string $arg2): void |
|
19 | + public function testDirectCallToBITAND(float | int | string $expectedResult, null | bool | int | float | string $arg1, null | bool | int | float | string $arg2): void |
|
20 | 20 | { |
21 | 21 | $result = BitWise::BITAND($arg1, $arg2); |
22 | 22 | self::assertSame($expectedResult, $result); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | /** |
26 | 26 | * @dataProvider providerBITAND |
27 | 27 | */ |
28 | - public function testBITANDAsFormula(float|int|string $expectedResult, mixed ...$args): void |
|
28 | + public function testBITANDAsFormula(float | int | string $expectedResult, mixed ...$args): void |
|
29 | 29 | { |
30 | 30 | $arguments = new FormulaArguments(...$args); |
31 | 31 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * @dataProvider providerBITAND |
41 | 41 | */ |
42 | - public function testBITANDInWorksheet(float|int|string $expectedResult, mixed ...$args): void |
|
42 | + public function testBITANDInWorksheet(float | int | string $expectedResult, mixed ...$args): void |
|
43 | 43 | { |
44 | 44 | $arguments = new FormulaArguments(...$args); |
45 | 45 |