Passed
Pull Request — master (#4432)
by
unknown
40:59 queued 27:38
created
src/PhpSpreadsheet/Calculation/Calculation.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         return array_key_exists($key, self::EXCEL_CONSTANTS);
162 162
     }
163 163
 
164
-    public static function getExcelConstants(string $key): bool|null
164
+    public static function getExcelConstants(string $key): bool | null
165 165
     {
166 166
         return self::EXCEL_CONSTANTS[$key];
167 167
     }
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
      *
529 529
      * @param string $formula Formula to parse
530 530
      */
531
-    public function parseFormula(string $formula): array|bool
531
+    public function parseFormula(string $formula): array | bool
532 532
     {
533 533
         $formula = preg_replace_callback(
534 534
             self::CALCULATION_REGEXP_CELLREF_SPILL,
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
     /**
944 944
      * @return false|string False indicates an error
945 945
      */
946
-    private function convertMatrixReferences(string $formula): false|string
946
+    private function convertMatrixReferences(string $formula): false | string
947 947
     {
948 948
         static $matrixReplaceFrom = [self::FORMULA_OPEN_MATRIX_BRACE, ';', self::FORMULA_CLOSE_MATRIX_BRACE];
949 949
         static $matrixReplaceTo = ['MKMATRIX(MKMATRIX(', '),MKMATRIX(', '))'];
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
     /**
1023 1023
      * @return array<int, mixed>|false
1024 1024
      */
1025
-    private function internalParseFormula(string $formula, ?Cell $cell = null): bool|array
1025
+    private function internalParseFormula(string $formula, ?Cell $cell = null): bool | array
1026 1026
     {
1027 1027
         if (($formula = $this->convertMatrixReferences(trim($formula))) === false) {
1028 1028
             return false;
@@ -1534,7 +1534,7 @@  discard block
 block discarded – undo
1534 1534
     /**
1535 1535
      * @return array<int, mixed>|false|string
1536 1536
      */
1537
-    private function processTokenStack(false|array $tokens, ?string $cellID = null, ?Cell $cell = null)
1537
+    private function processTokenStack(false | array $tokens, ?string $cellID = null, ?Cell $cell = null)
1538 1538
     {
1539 1539
         if ($tokens === false) {
1540 1540
             return false;
@@ -2180,7 +2180,7 @@  discard block
 block discarded – undo
2180 2180
         return $output;
2181 2181
     }
2182 2182
 
2183
-    private function validateBinaryOperand(mixed &$operand, Stack &$stack): bool
2183
+    private function validateBinaryOperand(mixed &$operand, Stack & $stack): bool
2184 2184
     {
2185 2185
         if (is_array($operand)) {
2186 2186
             if ((count($operand, COUNT_RECURSIVE) - count($operand)) == 1) {
@@ -2218,7 +2218,7 @@  discard block
 block discarded – undo
2218 2218
         return true;
2219 2219
     }
2220 2220
 
2221
-    private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays): array
2221
+    private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays): array
2222 2222
     {
2223 2223
         $result = [];
2224 2224
         if (!is_array($operand2) && is_array($operand1)) {
@@ -2262,7 +2262,7 @@  discard block
 block discarded – undo
2262 2262
         return $result;
2263 2263
     }
2264 2264
 
2265
-    private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays = false): array|bool
2265
+    private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays = false): array | bool
2266 2266
     {
2267 2267
         //    If we're dealing with matrix operations, we want a matrix result
2268 2268
         if ((is_array($operand1)) || (is_array($operand2))) {
@@ -2279,7 +2279,7 @@  discard block
 block discarded – undo
2279 2279
         return $result;
2280 2280
     }
2281 2281
 
2282
-    private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack): mixed
2282
+    private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack): mixed
2283 2283
     {
2284 2284
         //    Validate the two operands
2285 2285
         if (
@@ -2502,7 +2502,7 @@  discard block
 block discarded – undo
2502 2502
      *
2503 2503
      * @return array|string Array of values in range if range contains more than one element. Otherwise, a single value is returned.
2504 2504
      */
2505
-    public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string|array
2505
+    public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string | array
2506 2506
     {
2507 2507
         // Return value
2508 2508
         $returnValue = [];
@@ -2637,7 +2637,7 @@  discard block
 block discarded – undo
2637 2637
     /**
2638 2638
      * Add cell reference if needed while making sure that it is the last argument.
2639 2639
      */
2640
-    private function addCellReference(array $args, bool $passCellReference, array|string $functionCall, ?Cell $cell = null): array
2640
+    private function addCellReference(array $args, bool $passCellReference, array | string $functionCall, ?Cell $cell = null): array
2641 2641
     {
2642 2642
         if ($passCellReference) {
2643 2643
             if (is_array($functionCall)) {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Html.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1406,7 +1406,7 @@  discard block
 block discarded – undo
1406 1406
         }
1407 1407
     }
1408 1408
 
1409
-    private function generateRowCellData(Worksheet $worksheet, null|Cell|string $cell, array|string &$cssClass): string
1409
+    private function generateRowCellData(Worksheet $worksheet, null | Cell | string $cell, array | string &$cssClass): string
1410 1410
     {
1411 1411
         $cellData = '&nbsp;';
1412 1412
         if ($cell instanceof Cell) {
@@ -1487,7 +1487,7 @@  discard block
 block discarded – undo
1487 1487
         string $cellData,
1488 1488
         int $colSpan,
1489 1489
         int $rowSpan,
1490
-        array|string $cssClass,
1490
+        array | string $cssClass,
1491 1491
         int $colNum,
1492 1492
         int $sheetIndex,
1493 1493
         int $row,
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/Financial/Helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      *
25 25
      * @return int|string Result, or a string containing an error
26 26
      */
27
-    public static function daysPerYear(mixed $year, $basis = 0): string|int
27
+    public static function daysPerYear(mixed $year, $basis = 0): string | int
28 28
     {
29 29
         if (!is_int($year) && !is_string($year)) {
30 30
             return ExcelError::VALUE();
Please login to merge, or discard this patch.
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.