Failed Conditions
Pull Request — master (#3528)
by Owen
13:22
created
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) {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
     }
241 241
 
242 242
     /** @param array<int,float|int|numeric-string> $values> */
243
-    private static function xnpvOrdered(mixed $rate, mixed $values, mixed $dates, bool $ordered = true, bool $capAtNegative1 = false): float|string
243
+    private static function xnpvOrdered(mixed $rate, mixed $values, mixed $dates, bool $ordered = true, bool $capAtNegative1 = false): float | string
244 244
     {
245 245
         $rate = Functions::flattenSingleValue($rate);
246 246
         $values = Functions::flattenArray($values);
Please login to merge, or discard this patch.