Failed Conditions
Pull Request — master (#3723)
by Adrien
15:21 queued 02:18
created
src/PhpSpreadsheet/Calculation/Calculation.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3978,7 +3978,7 @@  discard block
 block discarded – undo
3978 3978
     /**
3979 3979
      * @return false|string False indicates an error
3980 3980
      */
3981
-    private function convertMatrixReferences(string $formula): false|string
3981
+    private function convertMatrixReferences(string $formula): false | string
3982 3982
     {
3983 3983
         static $matrixReplaceFrom = [self::FORMULA_OPEN_MATRIX_BRACE, ';', self::FORMULA_CLOSE_MATRIX_BRACE];
3984 3984
         static $matrixReplaceTo = ['MKMATRIX(MKMATRIX(', '),MKMATRIX(', '))'];
@@ -4081,7 +4081,7 @@  discard block
 block discarded – undo
4081 4081
      *
4082 4082
      * @return array<int, mixed>|false
4083 4083
      */
4084
-    private function internalParseFormula($formula, ?Cell $cell = null): bool|array
4084
+    private function internalParseFormula($formula, ?Cell $cell = null): bool | array
4085 4085
     {
4086 4086
         if (($formula = $this->convertMatrixReferences(trim($formula))) === false) {
4087 4087
             return false;
@@ -5219,7 +5219,7 @@  discard block
 block discarded – undo
5219 5219
         return true;
5220 5220
     }
5221 5221
 
5222
-    private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays): array
5222
+    private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays): array
5223 5223
     {
5224 5224
         $result = [];
5225 5225
         if (!is_array($operand2)) {
@@ -5258,7 +5258,7 @@  discard block
 block discarded – undo
5258 5258
         return $result;
5259 5259
     }
5260 5260
 
5261
-    private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays = false): array|bool
5261
+    private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays = false): array | bool
5262 5262
     {
5263 5263
         //    If we're dealing with matrix operations, we want a matrix result
5264 5264
         if ((is_array($operand1)) || (is_array($operand2))) {
@@ -5486,7 +5486,7 @@  discard block
 block discarded – undo
5486 5486
      *
5487 5487
      * @return array|string Array of values in range if range contains more than one element. Otherwise, a single value is returned.
5488 5488
      */
5489
-    public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string|array
5489
+    public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string | array
5490 5490
     {
5491 5491
         // Return value
5492 5492
         $returnValue = [];
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/Engineering.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      *                                If places is nonnumeric, DEC2BIN returns the #VALUE! error value.
242 242
      *                                If places is zero or negative, DEC2BIN returns the #NUM! error value.
243 243
      */
244
-    public static function DECTOBIN(mixed $x, mixed $places = null): string|array
244
+    public static function DECTOBIN(mixed $x, mixed $places = null): string | array
245 245
     {
246 246
         return Engineering\ConvertDecimal::toBinary($x, $places);
247 247
     }
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
      *                                If places is nonnumeric, DEC2HEX returns the #VALUE! error value.
276 276
      *                                If places is zero or negative, DEC2HEX returns the #NUM! error value.
277 277
      */
278
-    public static function DECTOHEX(mixed $x, mixed $places = null): string|array
278
+    public static function DECTOHEX(mixed $x, mixed $places = null): string | array
279 279
     {
280 280
         return Engineering\ConvertDecimal::toHex($x, $places);
281 281
     }
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
      *                                If places is nonnumeric, DEC2OCT returns the #VALUE! error value.
310 310
      *                                If places is zero or negative, DEC2OCT returns the #NUM! error value.
311 311
      */
312
-    public static function DECTOOCT(mixed $x, mixed $places = null): string|array
312
+    public static function DECTOOCT(mixed $x, mixed $places = null): string | array
313 313
     {
314 314
         return Engineering\ConvertDecimal::toOctal($x, $places);
315 315
     }
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
      *                                    If places is nonnumeric, OCT2HEX returns the #VALUE! error value.
517 517
      *                                    If places is negative, OCT2HEX returns the #NUM! error value.
518 518
      */
519
-    public static function OCTTOHEX(mixed $x, mixed $places = null): string|array
519
+    public static function OCTTOHEX(mixed $x, mixed $places = null): string | array
520 520
     {
521 521
         return Engineering\ConvertOctal::toHex($x, $places);
522 522
     }
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
      * @param string $complexNumber the complex number for which you want the imaginary
561 561
      *                                         coefficient
562 562
      */
563
-    public static function IMAGINARY($complexNumber): string|float|array
563
+    public static function IMAGINARY($complexNumber): string | float | array
564 564
     {
565 565
         return Engineering\Complex::IMAGINARY($complexNumber);
566 566
     }
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
      *
580 580
      * @param string $complexNumber the complex number for which you want the real coefficient
581 581
      */
582
-    public static function IMREAL($complexNumber): string|float|array
582
+    public static function IMREAL($complexNumber): string | float | array
583 583
     {
584 584
         return Engineering\Complex::IMREAL($complexNumber);
585 585
     }
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
      * @param float $upper upper bound for integrating ERF.
1248 1248
      *                                If omitted, ERF integrates between zero and lower_limit
1249 1249
      */
1250
-    public static function ERF($lower, $upper = null): float|string|array
1250
+    public static function ERF($lower, $upper = null): float | string | array
1251 1251
     {
1252 1252
         return Engineering\Erf::ERF($lower, $upper);
1253 1253
     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/MathTrig/SumSquares.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      *
21 21
      * @return float|string
22 22
      */
23
-    public static function sumSquare(mixed ...$args): string|int|float
23
+    public static function sumSquare(mixed ...$args): string | int | float
24 24
     {
25 25
         try {
26 26
             $returnValue = 0;
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      *
64 64
      * @return float|string
65 65
      */
66
-    public static function sumXSquaredMinusYSquared($matrixData1, $matrixData2): string|int|float
66
+    public static function sumXSquaredMinusYSquared($matrixData1, $matrixData2): string | int | float
67 67
     {
68 68
         try {
69 69
             $array1 = Functions::flattenArray($matrixData1);
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      *
92 92
      * @return float|string
93 93
      */
94
-    public static function sumXSquaredPlusYSquared($matrixData1, $matrixData2): string|int|float
94
+    public static function sumXSquaredPlusYSquared($matrixData1, $matrixData2): string | int | float
95 95
     {
96 96
         try {
97 97
             $array1 = Functions::flattenArray($matrixData1);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      *
120 120
      * @return float|string
121 121
      */
122
-    public static function sumXMinusYSquared($matrixData1, $matrixData2): string|int|float
122
+    public static function sumXMinusYSquared($matrixData1, $matrixData2): string | int | float
123 123
     {
124 124
         try {
125 125
             $array1 = Functions::flattenArray($matrixData1);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/MathTrig/SeriesSum.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      *
23 23
      * @return array|float|string The result, or a string containing an error
24 24
      */
25
-    public static function evaluate(mixed $x, mixed $n, mixed $m, ...$args): array|string|float|int
25
+    public static function evaluate(mixed $x, mixed $n, mixed $m, ...$args): array | string | float | int
26 26
     {
27 27
         if (is_array($x) || is_array($n) || is_array($m)) {
28 28
             return self::evaluateArrayArgumentsSubset([self::class, __FUNCTION__], 3, $x, $n, $m, ...$args);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/MathTrig/Lcm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
      *
50 50
      * @return int|string Lowest Common Multiplier, or a string containing an error
51 51
      */
52
-    public static function evaluate(mixed ...$args): int|string
52
+    public static function evaluate(mixed ...$args): int | string
53 53
     {
54 54
         try {
55 55
             $arrayArgs = [];
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
      *         If an array of numbers is passed as the argument, then the returned result will also be an array
21 21
      *            with the same dimensions
22 22
      */
23
-    public static function evaluate(mixed $number): array|string|int|float
23
+    public static function evaluate(mixed $number): array | string | int | float
24 24
     {
25 25
         if (is_array($number)) {
26 26
             return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/MathTrig/Random.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
      *
16 16
      * @return float 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
 block discarded – undo
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
 block discarded – undo
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, $wholeNumber = false): string|array
70
+    public static function randArray(mixed $rows = 1, mixed $columns = 1, mixed $min = 0, mixed $max = 1, $wholeNumber = false): string | array
71 71
     {
72 72
         try {
73 73
             $rows = (int) Helpers::validateNumericNullSubstitution($rows, 1);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
         return array_chunk(
88 88
             array_map(
89
-                function () use ($min, $max, $wholeNumber): int|float {
89
+                function () use ($min, $max, $wholeNumber): int | float {
90 90
                     return $wholeNumber
91 91
                         ? mt_rand((int) $min, (int) $max)
92 92
                         : (mt_rand() / mt_getrandmax()) * ($max - $min) + $min;
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/MathTrig/Ceiling.php 1 patch
Spacing   +3 added lines, -3 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): array|string|float
73
+    public static function math(mixed $number, mixed $significance = null, $mode = 0): 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);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      *         If an array of numbers is passed as an argument, then the returned result will also be an array
112 112
      *            with the same dimensions
113 113
      */
114
-    public static function precise(mixed $number, $significance = 1): array|string|float
114
+    public static function precise(mixed $number, $significance = 1): array | string | float
115 115
     {
116 116
         if (is_array($number) || is_array($significance)) {
117 117
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $significance);
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
     /**
144 144
      * Avoid Scrutinizer problems concerning complexity.
145 145
      */
146
-    private static function argumentsOk(float $number, float $significance): float|string
146
+    private static function argumentsOk(float $number, float $significance): float | string
147 147
     {
148 148
         if (empty($number * $significance)) {
149 149
             return 0.0;
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/MathTrig/Angle.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      *         If an array of numbers is passed as the argument, then the returned result will also be an array
21 21
      *            with the same dimensions
22 22
      */
23
-    public static function toDegrees(mixed $number): array|string|float
23
+    public static function toDegrees(mixed $number): array | string | float
24 24
     {
25 25
         if (is_array($number)) {
26 26
             return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      *         If an array of numbers is passed as the argument, then the returned result will also be an array
47 47
      *            with the same dimensions
48 48
      */
49
-    public static function toRadians(mixed $number): array|string|float
49
+    public static function toRadians(mixed $number): array | string | float
50 50
     {
51 51
         if (is_array($number)) {
52 52
             return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
Please login to merge, or discard this patch.