Passed
Pull Request — master (#4466)
by Owen
12:32
created
src/PhpSpreadsheet/Calculation/TextData/Text.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      * @return array<mixed>|int|string If an array of values is passed for the argument, then the returned result
24 24
      *            will also be an array with matching dimensions
25 25
      */
26
-    public static function length(mixed $value = ''): array|int|string
26
+    public static function length(mixed $value = ''): array | int | string
27 27
     {
28 28
         if (is_array($value)) {
29 29
             return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      * @return array<mixed>|bool|string If an array of values is passed for either of the arguments, then the returned result
52 52
      *            will also be an array with matching dimensions
53 53
      */
54
-    public static function exact(mixed $value1, mixed $value2): array|bool|string
54
+    public static function exact(mixed $value1, mixed $value2): array | bool | string
55 55
     {
56 56
         if (is_array($value1) || is_array($value2)) {
57 57
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value1, $value2);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * @return array<mixed>|string If an array of values is passed for the argument, then the returned result
77 77
      *            will also be an array with matching dimensions
78 78
      */
79
-    public static function test(mixed $testValue = ''): array|string
79
+    public static function test(mixed $testValue = ''): array | string
80 80
     {
81 81
         if (is_array($testValue)) {
82 82
             return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $testValue);
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      *
111 111
      * @return array<mixed>|string the array built from the text, split by the row and column delimiters, or an error string
112 112
      */
113
-    public static function split(mixed $text, $columnDelimiter = null, $rowDelimiter = null, bool $ignoreEmpty = false, bool $matchMode = true, mixed $padding = '#N/A'): array|string
113
+    public static function split(mixed $text, $columnDelimiter = null, $rowDelimiter = null, bool $ignoreEmpty = false, bool $matchMode = true, mixed $padding = '#N/A'): array | string
114 114
     {
115 115
         $text = Functions::flattenSingleValue($text);
116 116
         if (ErrorValue::isError($text, true)) {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/TextData/Format.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      * @return array<mixed>|string If an array of values is passed for either of the arguments, then the returned result
80 80
      *            will also be an array with matching dimensions
81 81
      */
82
-    public static function FIXEDFORMAT(mixed $value, mixed $decimals = 2, mixed $noCommas = false): array|string
82
+    public static function FIXEDFORMAT(mixed $value, mixed $decimals = 2, mixed $noCommas = false): array | string
83 83
     {
84 84
         if (is_array($value) || is_array($decimals) || is_array($noCommas)) {
85 85
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $decimals, $noCommas);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      * @return array<mixed>|string If an array of values is passed for either of the arguments, then the returned result
120 120
      *            will also be an array with matching dimensions
121 121
      */
122
-    public static function TEXTFORMAT(mixed $value, mixed $format): array|string
122
+    public static function TEXTFORMAT(mixed $value, mixed $format): array | string
123 123
     {
124 124
         if (is_array($value) || is_array($format)) {
125 125
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $format);
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
      * @return array<mixed>|string If an array of values is passed for either of the arguments, then the returned result
240 240
      *            will also be an array with matching dimensions
241 241
      */
242
-    public static function valueToText(mixed $value, mixed $format = false): array|string
242
+    public static function valueToText(mixed $value, mixed $format = false): array | string
243 243
     {
244 244
         if (is_array($value) || is_array($format)) {
245 245
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $format);
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
      *
283 283
      * @return array<mixed>|float|string
284 284
      */
285
-    public static function NUMBERVALUE(mixed $value = '', mixed $decimalSeparator = null, mixed $groupSeparator = null): array|string|float
285
+    public static function NUMBERVALUE(mixed $value = '', mixed $decimalSeparator = null, mixed $groupSeparator = null): array | string | float
286 286
     {
287 287
         if (is_array($value) || is_array($decimalSeparator) || is_array($groupSeparator)) {
288 288
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $decimalSeparator, $groupSeparator);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/TextData/Replace.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * @return array<mixed>|string If an array of values is passed for either of the arguments, then the returned result
29 29
      *            will also be an array with matching dimensions
30 30
      */
31
-    public static function replace(mixed $oldText, mixed $start, mixed $chars, mixed $newText): array|string
31
+    public static function replace(mixed $oldText, mixed $start, mixed $chars, mixed $newText): array | string
32 32
     {
33 33
         if (is_array($oldText) || is_array($start) || is_array($chars) || is_array($newText)) {
34 34
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $oldText, $start, $chars, $newText);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      * @return array<mixed>|string If an array of values is passed for either of the arguments, then the returned result
69 69
      *            will also be an array with matching dimensions
70 70
      */
71
-    public static function substitute(mixed $text = '', mixed $fromText = '', mixed $toText = '', mixed $instance = null): array|string
71
+    public static function substitute(mixed $text = '', mixed $fromText = '', mixed $toText = '', mixed $instance = null): array | string
72 72
     {
73 73
         if (is_array($text) || is_array($fromText) || is_array($toText) || is_array($instance)) {
74 74
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $text, $fromText, $toText, $instance);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/TextData/Trim.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
      * @return array<mixed>|string If an array of values is passed as the argument, then the returned result will also be an array
38 38
      *            with the same dimensions
39 39
      */
40
-    public static function spaces(mixed $stringValue = ''): array|string
40
+    public static function spaces(mixed $stringValue = ''): array | string
41 41
     {
42 42
         if (is_array($stringValue)) {
43 43
             return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $stringValue);
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
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      *
52 52
      * @return array<string>|string
53 53
      */
54
-    public static function actualCONCATENATE(...$args): array|string
54
+    public static function actualCONCATENATE(...$args): array | string
55 55
     {
56 56
         if (Functions::getCompatibilityMode() === Functions::COMPATIBILITY_GNUMERIC) {
57 57
             return self::CONCATENATE(...$args);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      *
74 74
      * @return array<string>|string
75 75
      */
76
-    private static function concatenate2Args(array|string $operand1, null|array|bool|float|int|string $operand2): array|string
76
+    private static function concatenate2Args(array | string $operand1, null | array | bool | float | int | string $operand2): array | string
77 77
     {
78 78
         if (is_array($operand1) || is_array($operand2)) {
79 79
             $operand1 = Calculation::boolToString($operand1);
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      *         If an array of values is passed for the $delimiter or $ignoreEmpty arguments, then the returned result
125 125
      *            will also be an array with matching dimensions
126 126
      */
127
-    public static function TEXTJOIN($delimiter = '', $ignoreEmpty = true, mixed ...$args): array|string
127
+    public static function TEXTJOIN($delimiter = '', $ignoreEmpty = true, mixed ...$args): array | string
128 128
     {
129 129
         if (is_array($delimiter) || is_array($ignoreEmpty)) {
130 130
             return self::evaluateArrayArgumentsSubset(
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
      *         If an array of values is passed for the $stringValue or $repeatCount arguments, then the returned result
184 184
      *            will also be an array with matching dimensions
185 185
      */
186
-    public static function builtinREPT(mixed $stringValue, mixed $repeatCount): array|string
186
+    public static function builtinREPT(mixed $stringValue, mixed $repeatCount): array | string
187 187
     {
188 188
         if (is_array($stringValue) || is_array($repeatCount)) {
189 189
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $stringValue, $repeatCount);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/TextData/CaseConvert.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      * @return array<mixed>|string If an array of values is passed as the argument, then the returned result will also be an array
22 22
      *            with the same dimensions
23 23
      */
24
-    public static function lower(mixed $mixedCaseValue): array|string
24
+    public static function lower(mixed $mixedCaseValue): array | string
25 25
     {
26 26
         if (is_array($mixedCaseValue)) {
27 27
             return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $mixedCaseValue);
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      * @return array<mixed>|string If an array of values is passed as the argument, then the returned result will also be an array
48 48
      *            with the same dimensions
49 49
      */
50
-    public static function upper(mixed $mixedCaseValue): array|string
50
+    public static function upper(mixed $mixedCaseValue): array | string
51 51
     {
52 52
         if (is_array($mixedCaseValue)) {
53 53
             return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $mixedCaseValue);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      * @return array<mixed>|string If an array of values is passed as the argument, then the returned result will also be an array
74 74
      *            with the same dimensions
75 75
      */
76
-    public static function proper(mixed $mixedCaseValue): array|string
76
+    public static function proper(mixed $mixedCaseValue): array | string
77 77
     {
78 78
         if (is_array($mixedCaseValue)) {
79 79
             return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $mixedCaseValue);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/TextData/Extract.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      *         If an array of values is passed for the $value or $chars arguments, then the returned result
25 25
      *            will also be an array with matching dimensions
26 26
      */
27
-    public static function left(mixed $value, mixed $chars = 1): array|string
27
+    public static function left(mixed $value, mixed $chars = 1): array | string
28 28
     {
29 29
         if (is_array($value) || is_array($chars)) {
30 30
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $chars);
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      *         If an array of values is passed for the $value, $start or $chars arguments, then the returned result
55 55
      *            will also be an array with matching dimensions
56 56
      */
57
-    public static function mid(mixed $value, mixed $start, mixed $chars): array|string
57
+    public static function mid(mixed $value, mixed $start, mixed $chars): array | string
58 58
     {
59 59
         if (is_array($value) || is_array($start) || is_array($chars)) {
60 60
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $start, $chars);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      *         If an array of values is passed for the $value or $chars arguments, then the returned result
84 84
      *            will also be an array with matching dimensions
85 85
      */
86
-    public static function right(mixed $value, mixed $chars = 1): array|string
86
+    public static function right(mixed $value, mixed $chars = 1): array | string
87 87
     {
88 88
         if (is_array($value) || is_array($chars)) {
89 89
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $chars);
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      *         If an array of values is passed for any of the arguments, then the returned result
127 127
      *            will also be an array with matching dimensions
128 128
      */
129
-    public static function before(mixed $text, $delimiter, mixed $instance = 1, mixed $matchMode = 0, mixed $matchEnd = 0, mixed $ifNotFound = '#N/A'): array|string
129
+    public static function before(mixed $text, $delimiter, mixed $instance = 1, mixed $matchMode = 0, mixed $matchEnd = 0, mixed $ifNotFound = '#N/A'): array | string
130 130
     {
131 131
         if (is_array($text) || is_array($instance) || is_array($matchMode) || is_array($matchEnd) || is_array($ifNotFound)) {
132 132
             return self::evaluateArrayArgumentsIgnore([self::class, __FUNCTION__], 1, $text, $delimiter, $instance, $matchMode, $matchEnd, $ifNotFound);
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
      *         If an array of values is passed for any of the arguments, then the returned result
191 191
      *            will also be an array with matching dimensions
192 192
      */
193
-    public static function after(mixed $text, $delimiter, mixed $instance = 1, mixed $matchMode = 0, mixed $matchEnd = 0, mixed $ifNotFound = '#N/A'): array|string
193
+    public static function after(mixed $text, $delimiter, mixed $instance = 1, mixed $matchMode = 0, mixed $matchEnd = 0, mixed $ifNotFound = '#N/A'): array | string
194 194
     {
195 195
         if (is_array($text) || is_array($instance) || is_array($matchMode) || is_array($matchEnd) || is_array($ifNotFound)) {
196 196
             return self::evaluateArrayArgumentsIgnore([self::class, __FUNCTION__], 1, $text, $delimiter, $instance, $matchMode, $matchEnd, $ifNotFound);
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
      *
235 235
      * @return array<string>|string
236 236
      */
237
-    private static function validateTextBeforeAfter(string $text, null|array|string $delimiter, int $instance, int $matchMode, int $matchEnd, mixed $ifNotFound): array|string
237
+    private static function validateTextBeforeAfter(string $text, null | array | string $delimiter, int $instance, int $matchMode, int $matchEnd, mixed $ifNotFound): array | string
238 238
     {
239 239
         $flags = self::matchFlags($matchMode);
240 240
         $delimiter = self::buildDelimiter($delimiter);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/Calculation.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         return array_key_exists($key, self::EXCEL_CONSTANTS);
165 165
     }
166 166
 
167
-    public static function getExcelConstants(string $key): bool|null
167
+    public static function getExcelConstants(string $key): bool | null
168 168
     {
169 169
         return self::EXCEL_CONSTANTS[$key];
170 170
     }
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
      *
544 544
      * @return array<mixed>|bool
545 545
      */
546
-    public function parseFormula(string $formula): array|bool
546
+    public function parseFormula(string $formula): array | bool
547 547
     {
548 548
         $formula = preg_replace_callback(
549 549
             self::CALCULATION_REGEXP_CELLREF_SPILL,
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
     /**
968 968
      * @return false|string False indicates an error
969 969
      */
970
-    private function convertMatrixReferences(string $formula): false|string
970
+    private function convertMatrixReferences(string $formula): false | string
971 971
     {
972 972
         //    Convert any Excel matrix references to the MKMATRIX() function
973 973
         if (str_contains($formula, self::FORMULA_OPEN_MATRIX_BRACE)) {
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
     /**
1044 1044
      * @return array<int, mixed>|false
1045 1045
      */
1046
-    private function internalParseFormula(string $formula, ?Cell $cell = null): bool|array
1046
+    private function internalParseFormula(string $formula, ?Cell $cell = null): bool | array
1047 1047
     {
1048 1048
         if (($formula = $this->convertMatrixReferences(trim($formula))) === false) {
1049 1049
             return false;
@@ -1563,7 +1563,7 @@  discard block
 block discarded – undo
1563 1563
      *
1564 1564
      * @return array<int, mixed>|false|string
1565 1565
      */
1566
-    private function processTokenStack(false|array $tokens, ?string $cellID = null, ?Cell $cell = null)
1566
+    private function processTokenStack(false | array $tokens, ?string $cellID = null, ?Cell $cell = null)
1567 1567
     {
1568 1568
         if ($tokens === false) {
1569 1569
             return false;
@@ -2234,7 +2234,7 @@  discard block
 block discarded – undo
2234 2234
         return $output;
2235 2235
     }
2236 2236
 
2237
-    private function validateBinaryOperand(mixed &$operand, Stack &$stack): bool
2237
+    private function validateBinaryOperand(mixed &$operand, Stack & $stack): bool
2238 2238
     {
2239 2239
         if (is_array($operand)) {
2240 2240
             if ((count($operand, COUNT_RECURSIVE) - count($operand)) == 1) {
@@ -2273,7 +2273,7 @@  discard block
 block discarded – undo
2273 2273
     }
2274 2274
 
2275 2275
     /** @return mixed[] */
2276
-    private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays): array
2276
+    private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays): array
2277 2277
     {
2278 2278
         $result = [];
2279 2279
         if (!is_array($operand2) && is_array($operand1)) {
@@ -2318,7 +2318,7 @@  discard block
 block discarded – undo
2318 2318
     }
2319 2319
 
2320 2320
     /** @return bool|mixed[] */
2321
-    private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays = false): array|bool
2321
+    private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays = false): array | bool
2322 2322
     {
2323 2323
         //    If we're dealing with matrix operations, we want a matrix result
2324 2324
         if ((is_array($operand1)) || (is_array($operand2))) {
@@ -2335,7 +2335,7 @@  discard block
 block discarded – undo
2335 2335
         return $result;
2336 2336
     }
2337 2337
 
2338
-    private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack): mixed
2338
+    private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack): mixed
2339 2339
     {
2340 2340
         //    Validate the two operands
2341 2341
         if (
@@ -2561,7 +2561,7 @@  discard block
 block discarded – undo
2561 2561
      *
2562 2562
      * @return mixed[]|string Array of values in range if range contains more than one element. Otherwise, a single value is returned.
2563 2563
      */
2564
-    public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string|array
2564
+    public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string | array
2565 2565
     {
2566 2566
         // Return value
2567 2567
         $returnValue = [];
@@ -2711,7 +2711,7 @@  discard block
 block discarded – undo
2711 2711
      *
2712 2712
      * @return mixed[]
2713 2713
      */
2714
-    private function addCellReference(array $args, bool $passCellReference, array|string $functionCall, ?Cell $cell = null): array
2714
+    private function addCellReference(array $args, bool $passCellReference, array | string $functionCall, ?Cell $cell = null): array
2715 2715
     {
2716 2716
         if ($passCellReference) {
2717 2717
             if (is_array($functionCall)) {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/MathTrig/Ceiling.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      *         If an array of numbers is passed as an argument, then the returned result will also be an array
71 71
      *            with the same dimensions
72 72
      */
73
-    public static function math(mixed $number, mixed $significance = null, $mode = 0, bool $checkSigns = false): array|string|float
73
+    public static function math(mixed $number, mixed $significance = null, $mode = 0, bool $checkSigns = false): array | string | float
74 74
     {
75 75
         if (is_array($number) || is_array($significance) || is_array($mode)) {
76 76
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $significance, $mode);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      *         If an array of numbers is passed as an argument, then the returned result will also be an array
117 117
      *            with the same dimensions
118 118
      */
119
-    public static function precise(mixed $number, $significance = 1): array|string|float
119
+    public static function precise(mixed $number, $significance = 1): array | string | float
120 120
     {
121 121
         if (is_array($number) || is_array($significance)) {
122 122
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $significance);
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      *
150 150
      * @return array<mixed>|float|string Rounded Number, or a string containing an error
151 151
      */
152
-    public static function mathOds(mixed $number, mixed $significance = null, $mode = 0): array|string|float
152
+    public static function mathOds(mixed $number, mixed $significance = null, $mode = 0): array | string | float
153 153
     {
154 154
         return self::math($number, $significance, $mode, true);
155 155
     }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     /**
166 166
      * Avoid Scrutinizer problems concerning complexity.
167 167
      */
168
-    private static function argumentsOk(float $number, float $significance): float|string
168
+    private static function argumentsOk(float $number, float $significance): float | string
169 169
     {
170 170
         if (empty($number * $significance)) {
171 171
             return 0.0;
Please login to merge, or discard this patch.