Passed
Pull Request — master (#4439)
by Owen
14:47
created
src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      *                                All other dates must be later than this date, but they may occur in any order
32 32
      * @param mixed $guess        An optional guess at the expected answer
33 33
      */
34
-    public static function rate(mixed $values, $dates, mixed $guess = self::DEFAULT_GUESS): float|string
34
+    public static function rate(mixed $values, $dates, mixed $guess = self::DEFAULT_GUESS): float | string
35 35
     {
36 36
         $rslt = self::xirrPart1($values, $dates);
37 37
         /** @var array $dates */
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      *                         The first payment date indicates the beginning of the schedule of payments.
120 120
      *                         All other dates must be later than this date, but they may occur in any order.
121 121
      */
122
-    public static function presentValue(mixed $rate, mixed $values, mixed $dates): float|string
122
+    public static function presentValue(mixed $rate, mixed $values, mixed $dates): float | string
123 123
     {
124 124
         return self::xnpvOrdered($rate, $values, $dates, true);
125 125
     }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         return '';
179 179
     }
180 180
 
181
-    private static function xirrPart3(array $values, array $dates, float $x1, float $x2): float|string
181
+    private static function xirrPart3(array $values, array $dates, float $x1, float $x2): float | string
182 182
     {
183 183
         $f = self::xnpvOrdered($x1, $values, $dates, false);
184 184
         if ($f < 0.0) {
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         return $rslt;
208 208
     }
209 209
 
210
-    private static function xirrBisection(array $values, array $dates, float $x1, float $x2): string|float
210
+    private static function xirrBisection(array $values, array $dates, float $x1, float $x2): string | float
211 211
     {
212 212
         $rslt = ExcelError::NAN();
213 213
         for ($i = 0; $i < self::FINANCIAL_MAX_ITERATIONS; ++$i) {
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
     }
245 245
 
246 246
     /** @param array<int,float|int|numeric-string> $values> */
247
-    private static function xnpvOrdered(mixed $rate, mixed $values, mixed $dates, bool $ordered = true, bool $capAtNegative1 = false): float|string
247
+    private static function xnpvOrdered(mixed $rate, mixed $values, mixed $dates, bool $ordered = true, bool $capAtNegative1 = false): float | string
248 248
     {
249 249
         $rate = Functions::flattenSingleValue($rate);
250 250
         if (!is_numeric($rate)) {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/DateTimeExcel/Helpers.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      *
18 18
      * @return bool TRUE if the year is a leap year, otherwise FALSE
19 19
      */
20
-    public static function isLeapYear(int|string $year): bool
20
+    public static function isLeapYear(int | string $year): bool
21 21
     {
22 22
         $year = (int) $year;
23 23
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      *
65 65
      * @return float|string Excel date/time serial value, or string if error
66 66
      */
67
-    public static function getTimeValue(string $timeValue): string|float
67
+    public static function getTimeValue(string $timeValue): string | float
68 68
     {
69 69
         $saveReturnDateType = Functions::getReturnDateType();
70 70
         Functions::setReturnDateType(Functions::RETURNDATE_EXCEL);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     /**
133 133
      * Return result in one of three formats.
134 134
      */
135
-    public static function returnIn3FormatsArray(array $dateArray, bool $noFrac = false): DateTime|float|int
135
+    public static function returnIn3FormatsArray(array $dateArray, bool $noFrac = false): DateTime | float | int
136 136
     {
137 137
         $retType = Functions::getReturnDateType();
138 138
         if ($retType === Functions::RETURNDATE_PHP_DATETIME_OBJECT) {
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     /**
166 166
      * Return result in one of three formats.
167 167
      */
168
-    public static function returnIn3FormatsFloat(float $excelDateValue): float|int|DateTime
168
+    public static function returnIn3FormatsFloat(float $excelDateValue): float | int | DateTime
169 169
     {
170 170
         $retType = Functions::getReturnDateType();
171 171
         if ($retType === Functions::RETURNDATE_EXCEL) {
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
     /**
183 183
      * Return result in one of three formats.
184 184
      */
185
-    public static function returnIn3FormatsObject(DateTime $PHPDateObject): DateTime|float|int
185
+    public static function returnIn3FormatsObject(DateTime $PHPDateObject): DateTime | float | int
186 186
     {
187 187
         $retType = Functions::getReturnDateType();
188 188
         if ($retType === Functions::RETURNDATE_PHP_DATETIME_OBJECT) {
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     /**
228 228
      * Many functions accept null argument treated as 0.
229 229
      */
230
-    public static function validateNumericNull(mixed $number): int|float
230
+    public static function validateNumericNull(mixed $number): int | float
231 231
     {
232 232
         $number = Functions::flattenSingleValue($number);
233 233
         if ($number === null) {
@@ -284,12 +284,12 @@  discard block
 block discarded – undo
284 284
      *
285 285
      * @param array|false $dateArray
286 286
      */
287
-    private static function forceArray(array|bool $dateArray): array
287
+    private static function forceArray(array | bool $dateArray): array
288 288
     {
289 289
         return is_array($dateArray) ? $dateArray : ['error_count' => 1];
290 290
     }
291 291
 
292
-    public static function floatOrInt(mixed $value): float|int
292
+    public static function floatOrInt(mixed $value): float | int
293 293
     {
294 294
         $result = Functions::scalar($value);
295 295
 
Please login to merge, or discard this patch.
tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     }
39 39
 
40 40
     #[DataProvider('providerDATE')]
41
-    public function testDirectCallToDATE(float|string $expectedResult, int|string $year, null|bool|float|int|string $month, float|int|string $day): void
41
+    public function testDirectCallToDATE(float | string $expectedResult, int | string $year, null | bool | float | int | string $month, float | int | string $day): void
42 42
     {
43 43
         $result = Date::fromYMD($year, $month, $day);
44 44
         self::assertSame($expectedResult, $result);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
      *         If an array of numbers is passed as the argument, then the returned result will also be an array
65 65
      *            with the same dimensions
66 66
      */
67
-    public static function fromYMD(array|float|int|string $year, null|array|bool|float|int|string $month, array|float|int|string $day): float|int|DateTime|string|array
67
+    public static function fromYMD(array | float | int | string $year, null | array | bool | float | int | string $month, array | float | int | string $day): float | int | DateTime | string | array
68 68
     {
69 69
         if (is_array($year) || is_array($month) || is_array($day)) {
70 70
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $year, $month, $day);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/Functions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@
 block discarded – undo
189 189
         return str_replace('""""', '""', $operator . $operand);
190 190
     }
191 191
 
192
-    private static function operandSpecialHandling(mixed $operand): bool|float|int|string
192
+    private static function operandSpecialHandling(mixed $operand): bool | float | int | string
193 193
     {
194 194
         if (is_numeric($operand) || is_bool($operand)) {
195 195
             return $operand;
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/TextData/Concatenate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      *
50 50
      * @param array $args data to be concatenated
51 51
      */
52
-    public static function actualCONCATENATE(...$args): array|string
52
+    public static function actualCONCATENATE(...$args): array | string
53 53
     {
54 54
         if (Functions::getCompatibilityMode() === Functions::COMPATIBILITY_GNUMERIC) {
55 55
             return self::CONCATENATE(...$args);
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         return $result;
66 66
     }
67 67
 
68
-    private static function concatenate2Args(array|string $operand1, null|array|bool|float|int|string $operand2): array|string
68
+    private static function concatenate2Args(array | string $operand1, null | array | bool | float | int | string $operand2): array | string
69 69
     {
70 70
         if (is_array($operand1) || is_array($operand2)) {
71 71
             $operand1 = Calculation::boolToString($operand1);
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      *         If an array of values is passed for the $delimiter or $ignoreEmpty arguments, then the returned result
114 114
      *            will also be an array with matching dimensions
115 115
      */
116
-    public static function TEXTJOIN($delimiter = '', $ignoreEmpty = true, mixed ...$args): array|string
116
+    public static function TEXTJOIN($delimiter = '', $ignoreEmpty = true, mixed ...$args): array | string
117 117
     {
118 118
         if (is_array($delimiter) || is_array($ignoreEmpty)) {
119 119
             return self::evaluateArrayArgumentsSubset(
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      *         If an array of values is passed for the $stringValue or $repeatCount arguments, then the returned result
172 172
      *            will also be an array with matching dimensions
173 173
      */
174
-    public static function builtinREPT(mixed $stringValue, mixed $repeatCount): array|string
174
+    public static function builtinREPT(mixed $stringValue, mixed $repeatCount): array | string
175 175
     {
176 176
         if (is_array($stringValue) || is_array($repeatCount)) {
177 177
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $stringValue, $repeatCount);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
      *                    in hidden rows
85 85
      * @param mixed[] $args A mixed data series of values
86 86
      */
87
-    public static function evaluate(mixed $functionType, ...$args): float|int|string
87
+    public static function evaluate(mixed $functionType, ...$args): float | int | string
88 88
     {
89 89
         /** @var Cell */
90 90
         $cellReference = array_pop($args);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/LookupRef/Offset.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      *
43 43
      * @return array|string An array containing a cell or range of cells, or a string on error
44 44
      */
45
-    public static function OFFSET(?string $cellAddress = null, $rows = 0, $columns = 0, $height = null, $width = null, ?Cell $cell = null): string|array
45
+    public static function OFFSET(?string $cellAddress = null, $rows = 0, $columns = 0, $height = null, $width = null, ?Cell $cell = null): string | array
46 46
     {
47 47
         /** @var int */
48 48
         $rows = Functions::flattenSingleValue($rows);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      * @return array|float|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
27 27
      *            with the same dimensions
28 28
      */
29
-    public static function distributionRightTail(mixed $value, mixed $degrees): array|string|int|float
29
+    public static function distributionRightTail(mixed $value, mixed $degrees): array | string | int | float
30 30
     {
31 31
         if (is_array($value) || is_array($degrees)) {
32 32
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $degrees);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      * @return array|float|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
69 69
      *            with the same dimensions
70 70
      */
71
-    public static function distributionLeftTail(mixed $value, mixed $degrees, mixed $cumulative): array|string|int|float
71
+    public static function distributionLeftTail(mixed $value, mixed $degrees, mixed $cumulative): array | string | int | float
72 72
     {
73 73
         if (is_array($value) || is_array($degrees) || is_array($cumulative)) {
74 74
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $degrees, $cumulative);
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
155 155
      *            with the same dimensions
156 156
      */
157
-    public static function inverseLeftTail(mixed $probability, mixed $degrees): array|string|float
157
+    public static function inverseLeftTail(mixed $probability, mixed $degrees): array | string | float
158 158
     {
159 159
         if (is_array($probability) || is_array($degrees)) {
160 160
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $degrees);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      * @param array $actual an array of observed frequencies
185 185
      * @param array $expected an array of expected frequencies
186 186
      */
187
-    public static function test($actual, $expected): float|string
187
+    public static function test($actual, $expected): float | string
188 188
     {
189 189
         $rows = count($actual);
190 190
         $actual = Functions::flattenArray($actual);
Please login to merge, or discard this patch.