Passed
Pull Request — master (#3860)
by Adrien
19:40 queued 09:20
created
src/PhpSpreadsheet/Calculation/MathTrig/SumSquares.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
      *
19 19
      * @param mixed ...$args Data values
20 20
      */
21
-    public static function sumSquare(mixed ...$args): string|int|float
21
+    public static function sumSquare(mixed ...$args): string | int | float
22 22
     {
23 23
         try {
24 24
             $returnValue = 0;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      * @param mixed[] $matrixData1 Matrix #1
60 60
      * @param mixed[] $matrixData2 Matrix #2
61 61
      */
62
-    public static function sumXSquaredMinusYSquared(array $matrixData1, array $matrixData2): string|int|float
62
+    public static function sumXSquaredMinusYSquared(array $matrixData1, array $matrixData2): string | int | float
63 63
     {
64 64
         try {
65 65
             $array1 = Functions::flattenArray($matrixData1);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      * @param mixed[] $matrixData1 Matrix #1
86 86
      * @param mixed[] $matrixData2 Matrix #2
87 87
      */
88
-    public static function sumXSquaredPlusYSquared(array $matrixData1, array $matrixData2): string|int|float
88
+    public static function sumXSquaredPlusYSquared(array $matrixData1, array $matrixData2): string | int | float
89 89
     {
90 90
         try {
91 91
             $array1 = Functions::flattenArray($matrixData1);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      * @param mixed[] $matrixData1 Matrix #1
112 112
      * @param mixed[] $matrixData2 Matrix #2
113 113
      */
114
-    public static function sumXMinusYSquared(array $matrixData1, array $matrixData2): string|int|float
114
+    public static function sumXMinusYSquared(array $matrixData1, array $matrixData2): string | int | float
115 115
     {
116 116
         try {
117 117
             $array1 = Functions::flattenArray($matrixData1);
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
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
      *                    in hidden rows
84 84
      * @param mixed[] $args A mixed data series of values
85 85
      */
86
-    public static function evaluate(mixed $functionType, ...$args): float|int|string
86
+    public static function evaluate(mixed $functionType, ...$args): float | int | string
87 87
     {
88 88
         $cellReference = array_pop($args);
89 89
         $bArgs = Functions::flattenArrayIndexed($args);
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|int|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/Factorial.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      *         If an array of numbers is passed as the argument, then the returned result will also be an array
28 28
      *            with the same dimensions
29 29
      */
30
-    public static function fact($factVal): array|string|float|int
30
+    public static function fact($factVal): array | string | float | int
31 31
     {
32 32
         if (is_array($factVal)) {
33 33
             return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $factVal);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      *         If an array of numbers is passed as the argument, then the returned result will also be an array
70 70
      *            with the same dimensions
71 71
      */
72
-    public static function factDouble($factVal): array|string|float|int
72
+    public static function factDouble($factVal): array | string | float | int
73 73
     {
74 74
         if (is_array($factVal)) {
75 75
             return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $factVal);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      *
102 102
      * @return float|int|string The result, or a string containing an error
103 103
      */
104
-    public static function multinomial(...$args): string|int|float
104
+    public static function multinomial(...$args): string | int | float
105 105
     {
106 106
         $summer = 0;
107 107
         $divisor = 1;
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/MathTrig/Operations.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
      *         If an array of numbers is passed as an argument, then the returned result will also be an array
24 24
      *            with the same dimensions
25 25
      */
26
-    public static function mod(mixed $dividend, mixed $divisor): array|string|float
26
+    public static function mod(mixed $dividend, mixed $divisor): array | string | float
27 27
     {
28 28
         if (is_array($dividend) || is_array($divisor)) {
29 29
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $dividend, $divisor);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      *         If an array of numbers is passed as an argument, then the returned result will also be an array
60 60
      *            with the same dimensions
61 61
      */
62
-    public static function power(array|float|int|string $x, array|float|int|string $y): array|float|int|string
62
+    public static function power(array | float | int | string $x, array | float | int | string $y): array | float | int | string
63 63
     {
64 64
         if (is_array($x) || is_array($y)) {
65 65
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $x, $y);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      *
97 97
      * @param mixed ...$args Data values
98 98
      */
99
-    public static function product(mixed ...$args): string|float
99
+    public static function product(mixed ...$args): string | float
100 100
     {
101 101
         $args = array_filter(
102 102
             Functions::flattenArray($args),
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
137 137
      *            with the same dimensions
138 138
      */
139
-    public static function quotient(mixed $numerator, mixed $denominator): array|string|int
139
+    public static function quotient(mixed $numerator, mixed $denominator): array | string | int
140 140
     {
141 141
         if (is_array($numerator) || is_array($denominator)) {
142 142
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $numerator, $denominator);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/MathTrig/Sum.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
      *
19 19
      * @param mixed ...$args Data values
20 20
      */
21
-    public static function sumIgnoringStrings(mixed ...$args): float|int|string
21
+    public static function sumIgnoringStrings(mixed ...$args): float | int | string
22 22
     {
23 23
         $returnValue = 0;
24 24
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      *
46 46
      * @param mixed ...$args Data values
47 47
      */
48
-    public static function sumErroringStrings(mixed ...$args): float|int|string|array
48
+    public static function sumErroringStrings(mixed ...$args): float | int | string | array
49 49
     {
50 50
         $returnValue = 0;
51 51
         // Loop through the arguments
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      *
78 78
      * @return float|int|string The result, or a string containing an error
79 79
      */
80
-    public static function product(mixed ...$args): string|int|float
80
+    public static function product(mixed ...$args): string | int | float
81 81
     {
82 82
         $arrayList = $args;
83 83
 
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|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
 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, 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
 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/Trunc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
      *         If an array of numbers is passed as an argument, then the returned result will also be an array
22 22
      *            with the same dimensions
23 23
      */
24
-    public static function evaluate(array|float|string|null $value = 0, array|int|string $digits = 0): array|float|string
24
+    public static function evaluate(array | float | string | null $value = 0, array | int | string $digits = 0): array | float | string
25 25
     {
26 26
         if (is_array($value) || is_array($digits)) {
27 27
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $digits);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/Calculation.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -3273,10 +3273,10 @@  discard block
 block discarded – undo
3273 3273
     }
3274 3274
 
3275 3275
     /** @var ?array */
3276
-    private static ?array $functionReplaceFromExcel;
3276
+    private static ? array $functionReplaceFromExcel;
3277 3277
 
3278 3278
     /** @var ?array */
3279
-    private static ?array $functionReplaceToLocale;
3279
+    private static ? array $functionReplaceToLocale;
3280 3280
 
3281 3281
     /**
3282 3282
      * @deprecated 1.30.0 use translateFormulaToLocale() instead
@@ -3322,10 +3322,10 @@  discard block
 block discarded – undo
3322 3322
     }
3323 3323
 
3324 3324
     /** @var ?array */
3325
-    private static ?array $functionReplaceFromLocale;
3325
+    private static ? array $functionReplaceFromLocale;
3326 3326
 
3327 3327
     /** @var ?array */
3328
-    private static ?array $functionReplaceToExcel;
3328
+    private static ? array $functionReplaceToExcel;
3329 3329
 
3330 3330
     /**
3331 3331
      * @deprecated 1.30.0 use translateFormulaToEnglish() instead
@@ -3533,7 +3533,7 @@  discard block
 block discarded – undo
3533 3533
      *
3534 3534
      * @param string $formula Formula to parse
3535 3535
      */
3536
-    public function parseFormula(string $formula): array|bool
3536
+    public function parseFormula(string $formula): array | bool
3537 3537
     {
3538 3538
         //    Basic validation that this is indeed a formula
3539 3539
         //    We return an empty array if not
@@ -3927,7 +3927,7 @@  discard block
 block discarded – undo
3927 3927
     /**
3928 3928
      * @return false|string False indicates an error
3929 3929
      */
3930
-    private function convertMatrixReferences(string $formula): false|string
3930
+    private function convertMatrixReferences(string $formula): false | string
3931 3931
     {
3932 3932
         static $matrixReplaceFrom = [self::FORMULA_OPEN_MATRIX_BRACE, ';', self::FORMULA_CLOSE_MATRIX_BRACE];
3933 3933
         static $matrixReplaceTo = ['MKMATRIX(MKMATRIX(', '),MKMATRIX(', '))'];
@@ -4022,7 +4022,7 @@  discard block
 block discarded – undo
4022 4022
     /**
4023 4023
      * @return array<int, mixed>|false
4024 4024
      */
4025
-    private function internalParseFormula(string $formula, ?Cell $cell = null): bool|array
4025
+    private function internalParseFormula(string $formula, ?Cell $cell = null): bool | array
4026 4026
     {
4027 4027
         if (($formula = $this->convertMatrixReferences(trim($formula))) === false) {
4028 4028
             return false;
@@ -5148,7 +5148,7 @@  discard block
 block discarded – undo
5148 5148
         return true;
5149 5149
     }
5150 5150
 
5151
-    private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays): array
5151
+    private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays): array
5152 5152
     {
5153 5153
         $result = [];
5154 5154
         if (!is_array($operand2)) {
@@ -5187,7 +5187,7 @@  discard block
 block discarded – undo
5187 5187
         return $result;
5188 5188
     }
5189 5189
 
5190
-    private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays = false): array|bool
5190
+    private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack, bool $recursingArrays = false): array | bool
5191 5191
     {
5192 5192
         //    If we're dealing with matrix operations, we want a matrix result
5193 5193
         if ((is_array($operand1)) || (is_array($operand2))) {
@@ -5204,7 +5204,7 @@  discard block
 block discarded – undo
5204 5204
         return $result;
5205 5205
     }
5206 5206
 
5207
-    private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack): mixed
5207
+    private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack & $stack): mixed
5208 5208
     {
5209 5209
         //    Validate the two operands
5210 5210
         if (
@@ -5409,7 +5409,7 @@  discard block
 block discarded – undo
5409 5409
      *
5410 5410
      * @return array|string Array of values in range if range contains more than one element. Otherwise, a single value is returned.
5411 5411
      */
5412
-    public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string|array
5412
+    public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string | array
5413 5413
     {
5414 5414
         // Return value
5415 5415
         $returnValue = [];
@@ -5550,7 +5550,7 @@  discard block
 block discarded – undo
5550 5550
     /**
5551 5551
      * Add cell reference if needed while making sure that it is the last argument.
5552 5552
      */
5553
-    private function addCellReference(array $args, bool $passCellReference, array|string $functionCall, ?Cell $cell = null): array
5553
+    private function addCellReference(array $args, bool $passCellReference, array | string $functionCall, ?Cell $cell = null): array
5554 5554
     {
5555 5555
         if ($passCellReference) {
5556 5556
             if (is_array($functionCall)) {
Please login to merge, or discard this patch.