@@ -116,7 +116,7 @@ |
||
116 | 116 | * |
117 | 117 | * @return string Formatted string |
118 | 118 | */ |
119 | - public static function toFormattedString($value, string $format, null|array|callable $callBack = null): string |
|
119 | + public static function toFormattedString($value, string $format, null | array | callable $callBack = null): string |
|
120 | 120 | { |
121 | 121 | while (is_array($value)) { |
122 | 122 | $value = array_shift($value); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * |
16 | 16 | * @return float|int Random number |
17 | 17 | */ |
18 | - public static function rand(): int|float |
|
18 | + public static function rand(): int | float |
|
19 | 19 | { |
20 | 20 | return mt_rand(0, 10000000) / 10000000; |
21 | 21 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * If an array of numbers is passed as an argument, then the returned result will also be an array |
33 | 33 | * with the same dimensions |
34 | 34 | */ |
35 | - public static function randBetween(mixed $min, mixed $max): array|string|int |
|
35 | + public static function randBetween(mixed $min, mixed $max): array | string | int |
|
36 | 36 | { |
37 | 37 | if (is_array($min) || is_array($max)) { |
38 | 38 | return self::evaluateArrayArguments([self::class, __FUNCTION__], $min, $max); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @return array|string The resulting array, or a string containing an error |
69 | 69 | */ |
70 | - public static function randArray(mixed $rows = 1, mixed $columns = 1, mixed $min = 0, mixed $max = 1, bool $wholeNumber = false): string|array |
|
70 | + public static function randArray(mixed $rows = 1, mixed $columns = 1, mixed $min = 0, mixed $max = 1, bool $wholeNumber = false): string | array |
|
71 | 71 | { |
72 | 72 | try { |
73 | 73 | $rows = (int) Helpers::validateNumericNullSubstitution($rows, 1); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | return array_chunk( |
88 | 88 | array_map( |
89 | - fn (): int|float => $wholeNumber |
|
89 | + fn (): int | float => $wholeNumber |
|
90 | 90 | ? mt_rand((int) $min, (int) $max) |
91 | 91 | : (mt_rand() / mt_getrandmax()) * ($max - $min) + $min, |
92 | 92 | array_fill(0, $rows * $columns, $min) |
@@ -74,7 +74,7 @@ |
||
74 | 74 | return $formula; |
75 | 75 | } |
76 | 76 | |
77 | - private function numericOperator(DataValidation $dataValidation, int|float $cellValue, Cell $cell): bool |
|
77 | + private function numericOperator(DataValidation $dataValidation, int | float $cellValue, Cell $cell): bool |
|
78 | 78 | { |
79 | 79 | $operator = $dataValidation->getOperator(); |
80 | 80 | $formula1 = self::evaluateNumericFormula( |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | #[DataProvider('providerCreationTime')] |
49 | - public function testSetCreated(null|int $expectedCreationTime, null|int|string $created): void |
|
49 | + public function testSetCreated(null | int $expectedCreationTime, null | int | string $created): void |
|
50 | 50 | { |
51 | 51 | if ($expectedCreationTime === null) { |
52 | 52 | do { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | #[DataProvider('providerModifiedTime')] |
83 | - public function testSetModified(mixed $expectedModifiedTime, null|int|string $modified): void |
|
83 | + public function testSetModified(mixed $expectedModifiedTime, null | int | string $modified): void |
|
84 | 84 | { |
85 | 85 | if ($expectedModifiedTime === null) { |
86 | 86 | do { |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | } |
163 | 163 | |
164 | 164 | #[DataProvider('providerCustomProperties')] |
165 | - public function testSetCustomProperties(mixed $expectedType, mixed $expectedValue, string $propertyName, null|bool|float|int|string $propertyValue, ?string $propertyType = null): void |
|
165 | + public function testSetCustomProperties(mixed $expectedType, mixed $expectedValue, string $propertyName, null | bool | float | int | string $propertyValue, ?string $propertyType = null): void |
|
166 | 166 | { |
167 | 167 | if ($propertyType === null) { |
168 | 168 | $this->properties->setCustomProperty($propertyName, $propertyValue); |
@@ -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)"); |
@@ -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); |