Failed Conditions
Pull Request — master (#3873)
by Adrien
13:56
created
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.
src/PhpSpreadsheet/Calculation/TextData/Format.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * @return array|string If an array of values is passed for either of the arguments, then the returned result
77 77
      *            will also be an array with matching dimensions
78 78
      */
79
-    public static function FIXEDFORMAT(mixed $value, mixed $decimals = 2, mixed $noCommas = false): array|string
79
+    public static function FIXEDFORMAT(mixed $value, mixed $decimals = 2, mixed $noCommas = false): array | string
80 80
     {
81 81
         if (is_array($value) || is_array($decimals) || is_array($noCommas)) {
82 82
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $decimals, $noCommas);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      * @return array|string If an array of values is passed for either of the arguments, then the returned result
117 117
      *            will also be an array with matching dimensions
118 118
      */
119
-    public static function TEXTFORMAT(mixed $value, mixed $format): array|string
119
+    public static function TEXTFORMAT(mixed $value, mixed $format): array | string
120 120
     {
121 121
         if (is_array($value) || is_array($format)) {
122 122
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $format);
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
      * @return array|string If an array of values is passed for either of the arguments, then the returned result
224 224
      *            will also be an array with matching dimensions
225 225
      */
226
-    public static function valueToText(mixed $value, mixed $format = false): array|string
226
+    public static function valueToText(mixed $value, mixed $format = false): array | string
227 227
     {
228 228
         if (is_array($value) || is_array($format)) {
229 229
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $format);
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
      * @param mixed $groupSeparator A string with the group/thousands separator to use, defaults to locale defined value
265 265
      *                         Or can be an array of values
266 266
      */
267
-    public static function NUMBERVALUE(mixed $value = '', mixed $decimalSeparator = null, mixed $groupSeparator = null): array|string|float
267
+    public static function NUMBERVALUE(mixed $value = '', mixed $decimalSeparator = null, mixed $groupSeparator = null): array | string | float
268 268
     {
269 269
         if (is_array($value) || is_array($decimalSeparator) || is_array($groupSeparator)) {
270 270
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $decimalSeparator, $groupSeparator);
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|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/CaseConvert.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
      * @return array|string If an array of values 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 lower(mixed $mixedCaseValue): array|string
23
+    public static function lower(mixed $mixedCaseValue): array | string
24 24
     {
25 25
         if (is_array($mixedCaseValue)) {
26 26
             return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $mixedCaseValue);
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      * @return array|string If an array of values is passed as the argument, then the returned result will also be an array
43 43
      *            with the same dimensions
44 44
      */
45
-    public static function upper(mixed $mixedCaseValue): array|string
45
+    public static function upper(mixed $mixedCaseValue): array | string
46 46
     {
47 47
         if (is_array($mixedCaseValue)) {
48 48
             return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $mixedCaseValue);
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * @return array|string If an array of values 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 proper(mixed $mixedCaseValue): array|string
67
+    public static function proper(mixed $mixedCaseValue): array | string
68 68
     {
69 69
         if (is_array($mixedCaseValue)) {
70 70
             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);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      *         If an array of values is passed for any of the arguments, then the returned result
185 185
      *            will also be an array with matching dimensions
186 186
      */
187
-    public static function after(mixed $text, $delimiter, mixed $instance = 1, mixed $matchMode = 0, mixed $matchEnd = 0, mixed $ifNotFound = '#N/A'): array|string
187
+    public static function after(mixed $text, $delimiter, mixed $instance = 1, mixed $matchMode = 0, mixed $matchEnd = 0, mixed $ifNotFound = '#N/A'): array | string
188 188
     {
189 189
         if (is_array($text) || is_array($instance) || is_array($matchMode) || is_array($matchEnd) || is_array($ifNotFound)) {
190 190
             return self::evaluateArrayArgumentsIgnore([self::class, __FUNCTION__], 1, $text, $delimiter, $instance, $matchMode, $matchEnd, $ifNotFound);
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         return implode('', $split);
217 217
     }
218 218
 
219
-    private static function validateTextBeforeAfter(string $text, null|array|string $delimiter, int $instance, int $matchMode, int $matchEnd, mixed $ifNotFound): array|string
219
+    private static function validateTextBeforeAfter(string $text, null | array | string $delimiter, int $instance, int $matchMode, int $matchEnd, mixed $ifNotFound): array | string
220 220
     {
221 221
         $flags = self::matchFlags($matchMode);
222 222
         $delimiter = self::buildDelimiter($delimiter);
Please login to merge, or discard this patch.