Passed
Pull Request — master (#3793)
by Adrien
14:11
created
Category
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.
src/PhpSpreadsheet/Calculation/Financial/CashFlow/Single.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      * @param mixed $principal the present value
21 21
      * @param float[] $schedule an array of interest rates to apply
22 22
      */
23
-    public static function futureValue(mixed $principal, array $schedule): string|float
23
+    public static function futureValue(mixed $principal, array $schedule): string | float
24 24
     {
25 25
         $principal = Functions::flattenSingleValue($principal);
26 26
         $schedule = Functions::flattenArray($schedule);
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      *
51 51
      * @return float|string Result, or a string containing an error
52 52
      */
53
-    public static function periods(mixed $rate, mixed $presentValue, mixed $futureValue): string|float
53
+    public static function periods(mixed $rate, mixed $presentValue, mixed $futureValue): string | float
54 54
     {
55 55
         $rate = Functions::flattenSingleValue($rate);
56 56
         $presentValue = Functions::flattenSingleValue($presentValue);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      *
84 84
      * @return float|string Result, or a string containing an error
85 85
      */
86
-    public static function interestRate(array|float $periods = 0.0, array|float $presentValue = 0.0, array|float $futureValue = 0.0): string|float
86
+    public static function interestRate(array | float $periods = 0.0, array | float $presentValue = 0.0, array | float $futureValue = 0.0): string | float
87 87
     {
88 88
         $periods = Functions::flattenSingleValue($periods);
89 89
         $presentValue = Functions::flattenSingleValue($presentValue);
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
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *                                All other dates must be later than this date, but they may occur in any order
31 31
      * @param mixed $guess        An optional guess at the expected answer
32 32
      */
33
-    public static function rate(array $values, array $dates, mixed $guess = self::DEFAULT_GUESS): float|string
33
+    public static function rate(array $values, array $dates, mixed $guess = self::DEFAULT_GUESS): float | string
34 34
     {
35 35
         $rslt = self::xirrPart1($values, $dates);
36 36
         if ($rslt !== '') {
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      *                         The first payment date indicates the beginning of the schedule of payments.
118 118
      *                         All other dates must be later than this date, but they may occur in any order.
119 119
      */
120
-    public static function presentValue(array|float $rate, array $values, array $dates): float|string
120
+    public static function presentValue(array | float $rate, array $values, array $dates): float | string
121 121
     {
122 122
         return self::xnpvOrdered($rate, $values, $dates, true);
123 123
     }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         return '';
175 175
     }
176 176
 
177
-    private static function xirrPart3(array $values, array $dates, float $x1, float $x2): float|string
177
+    private static function xirrPart3(array $values, array $dates, float $x1, float $x2): float | string
178 178
     {
179 179
         $f = self::xnpvOrdered($x1, $values, $dates, false);
180 180
         if ($f < 0.0) {
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         return $rslt;
204 204
     }
205 205
 
206
-    private static function xirrBisection(array $values, array $dates, float $x1, float $x2): string|float
206
+    private static function xirrBisection(array $values, array $dates, float $x1, float $x2): string | float
207 207
     {
208 208
         $rslt = ExcelError::NAN();
209 209
         for ($i = 0; $i < self::FINANCIAL_MAX_ITERATIONS; ++$i) {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
         return $rslt;
240 240
     }
241 241
 
242
-    private static function xnpvOrdered(mixed $rate, mixed $values, mixed $dates, bool $ordered = true, bool $capAtNegative1 = false): float|string
242
+    private static function xnpvOrdered(mixed $rate, mixed $values, mixed $dates, bool $ordered = true, bool $capAtNegative1 = false): float | string
243 243
     {
244 244
         $rate = Functions::flattenSingleValue($rate);
245 245
         $values = Functions::flattenArray($values);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      *                                    calculate the internal rate of return.
30 30
      * @param mixed $guess A number that you guess is close to the result of IRR
31 31
      */
32
-    public static function rate(mixed $values, mixed $guess = 0.1): string|float
32
+    public static function rate(mixed $values, mixed $guess = 0.1): string | float
33 33
     {
34 34
         if (!is_array($values)) {
35 35
             return ExcelError::VALUE();
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      *
98 98
      * @return float|string Result, or a string containing an error
99 99
      */
100
-    public static function modifiedRate(mixed $values, mixed $financeRate, mixed $reinvestmentRate): string|float
100
+    public static function modifiedRate(mixed $values, mixed $financeRate, mixed $reinvestmentRate): string | float
101 101
     {
102 102
         if (!is_array($values)) {
103 103
             return ExcelError::DIV0();
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      *
137 137
      * @param array $args
138 138
      */
139
-    public static function presentValue(mixed $rate, ...$args): int|float
139
+    public static function presentValue(mixed $rate, ...$args): int | float
140 140
     {
141 141
         $returnValue = 0;
142 142
 
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/Financial/Depreciation.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      * @param mixed $month Number of months in the first year. If month is omitted,
34 34
      *                         it defaults to 12.
35 35
      */
36
-    public static function DB(mixed $cost, mixed $salvage, mixed $life, mixed $period, mixed $month = 12): string|float|int
36
+    public static function DB(mixed $cost, mixed $salvage, mixed $life, mixed $period, mixed $month = 12): string | float | int
37 37
     {
38 38
         $cost = Functions::flattenSingleValue($cost);
39 39
         $salvage = Functions::flattenSingleValue($salvage);
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      *                                If factor is omitted, it is assumed to be 2 (the
98 98
      *                                double-declining balance method).
99 99
      */
100
-    public static function DDB(mixed $cost, mixed $salvage, mixed $life, mixed $period, mixed $factor = 2.0): float|string
100
+    public static function DDB(mixed $cost, mixed $salvage, mixed $life, mixed $period, mixed $factor = 2.0): float | string
101 101
     {
102 102
         $cost = Functions::flattenSingleValue($cost);
103 103
         $salvage = Functions::flattenSingleValue($salvage);
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
      *
146 146
      * @return float|string Result, or a string containing an error
147 147
      */
148
-    public static function SLN(mixed $cost, mixed $salvage, mixed $life): string|float
148
+    public static function SLN(mixed $cost, mixed $salvage, mixed $life): string | float
149 149
     {
150 150
         $cost = Functions::flattenSingleValue($cost);
151 151
         $salvage = Functions::flattenSingleValue($salvage);
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
      *
179 179
      * @return float|string Result, or a string containing an error
180 180
      */
181
-    public static function SYD(mixed $cost, mixed $salvage, mixed $life, mixed $period): string|float
181
+    public static function SYD(mixed $cost, mixed $salvage, mixed $life, mixed $period): string | float
182 182
     {
183 183
         $cost = Functions::flattenSingleValue($cost);
184 184
         $salvage = Functions::flattenSingleValue($salvage);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/Financial/Securities/Rates.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         mixed $price,
39 39
         mixed $redemption,
40 40
         mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
41
-    ): float|string {
41
+    ): float | string {
42 42
         $settlement = Functions::flattenSingleValue($settlement);
43 43
         $maturity = Functions::flattenSingleValue($maturity);
44 44
         $price = Functions::flattenSingleValue($price);
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         mixed $investment,
100 100
         mixed $redemption,
101 101
         mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
102
-    ): float|string {
102
+    ): float | string {
103 103
         $settlement = Functions::flattenSingleValue($settlement);
104 104
         $maturity = Functions::flattenSingleValue($maturity);
105 105
         $investment = Functions::flattenSingleValue($investment);
Please login to merge, or discard this patch.