@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $period, |
48 | 48 | $rate, |
49 | 49 | $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD |
50 | - ): string|float { |
|
50 | + ): string | float { |
|
51 | 51 | $cost = Functions::flattenSingleValue($cost); |
52 | 52 | $purchased = Functions::flattenSingleValue($purchased); |
53 | 53 | $firstPeriod = Functions::flattenSingleValue($firstPeriod); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $period, |
137 | 137 | $rate, |
138 | 138 | $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD |
139 | - ): string|float { |
|
139 | + ): string | float { |
|
140 | 140 | $cost = Functions::flattenSingleValue($cost); |
141 | 141 | $purchased = Functions::flattenSingleValue($purchased); |
142 | 142 | $firstPeriod = Functions::flattenSingleValue($firstPeriod); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @return float|string Result, or a string containing an error |
26 | 26 | */ |
27 | - public static function bondEquivalentYield($settlement, $maturity, $discount): string|float |
|
27 | + public static function bondEquivalentYield($settlement, $maturity, $discount): string | float |
|
28 | 28 | { |
29 | 29 | $settlement = Functions::flattenSingleValue($settlement); |
30 | 30 | $maturity = Functions::flattenSingleValue($maturity); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @return float|string Result, or a string containing an error |
71 | 71 | */ |
72 | - public static function price($settlement, $maturity, $discount): string|float |
|
72 | + public static function price($settlement, $maturity, $discount): string | float |
|
73 | 73 | { |
74 | 74 | $settlement = Functions::flattenSingleValue($settlement); |
75 | 75 | $maturity = Functions::flattenSingleValue($maturity); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * The maturity date is the date when the Treasury bill expires. |
118 | 118 | * @param float|string $price The Treasury bill's price per $100 face value |
119 | 119 | */ |
120 | - public static function yield($settlement, $maturity, $price): string|float |
|
120 | + public static function yield($settlement, $maturity, $price): string | float |
|
121 | 121 | { |
122 | 122 | $settlement = Functions::flattenSingleValue($settlement); |
123 | 123 | $maturity = Functions::flattenSingleValue($maturity); |
@@ -20,7 +20,7 @@ discard block |
||
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($principal, $schedule): string|float |
|
23 | + public static function futureValue($principal, $schedule): string | float |
|
24 | 24 | { |
25 | 25 | $principal = Functions::flattenSingleValue($principal); |
26 | 26 | $schedule = Functions::flattenArray($schedule); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @return float|string Result, or a string containing an error |
52 | 52 | */ |
53 | - public static function periods($rate, $presentValue, $futureValue): string|float |
|
53 | + public static function periods($rate, $presentValue, $futureValue): string | float |
|
54 | 54 | { |
55 | 55 | $rate = Functions::flattenSingleValue($rate); |
56 | 56 | $presentValue = Functions::flattenSingleValue($presentValue); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * |
84 | 84 | * @return float|string Result, or a string containing an error |
85 | 85 | */ |
86 | - public static function interestRate($periods = 0.0, $presentValue = 0.0, $futureValue = 0.0): string|float |
|
86 | + public static function interestRate($periods = 0.0, $presentValue = 0.0, $futureValue = 0.0): string | float |
|
87 | 87 | { |
88 | 88 | $periods = Functions::flattenSingleValue($periods); |
89 | 89 | $presentValue = Functions::flattenSingleValue($presentValue); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | return ''; |
183 | 183 | } |
184 | 184 | |
185 | - private static function xirrPart3(array $values, array $dates, float $x1, float $x2): float|string |
|
185 | + private static function xirrPart3(array $values, array $dates, float $x1, float $x2): float | string |
|
186 | 186 | { |
187 | 187 | $f = self::xnpvOrdered($x1, $values, $dates, false); |
188 | 188 | if ($f < 0.0) { |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | return $rslt; |
212 | 212 | } |
213 | 213 | |
214 | - private static function xirrBisection(array $values, array $dates, float $x1, float $x2): string|float |
|
214 | + private static function xirrBisection(array $values, array $dates, float $x1, float $x2): string | float |
|
215 | 215 | { |
216 | 216 | $rslt = ExcelError::NAN(); |
217 | 217 | for ($i = 0; $i < self::FINANCIAL_MAX_ITERATIONS; ++$i) { |
@@ -29,7 +29,7 @@ discard block |
||
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($values, $guess = 0.1): string|float |
|
32 | + public static function rate($values, $guess = 0.1): string | float |
|
33 | 33 | { |
34 | 34 | if (!is_array($values)) { |
35 | 35 | return ExcelError::VALUE(); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @return float|string Result, or a string containing an error |
99 | 99 | */ |
100 | - public static function modifiedRate($values, $financeRate, $reinvestmentRate): string|float |
|
100 | + public static function modifiedRate($values, $financeRate, $reinvestmentRate): string | float |
|
101 | 101 | { |
102 | 102 | if (!is_array($values)) { |
103 | 103 | return ExcelError::DIV0(); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * |
147 | 147 | * @return float |
148 | 148 | */ |
149 | - public static function presentValue($rate, ...$args): int|float |
|
149 | + public static function presentValue($rate, ...$args): int | float |
|
150 | 150 | { |
151 | 151 | $returnValue = 0; |
152 | 152 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $start, |
38 | 38 | $end, |
39 | 39 | $type = FinancialConstants::PAYMENT_END_OF_PERIOD |
40 | - ): string|float|int { |
|
40 | + ): string | float | int { |
|
41 | 41 | $rate = Functions::flattenSingleValue($rate); |
42 | 42 | $periods = Functions::flattenSingleValue($periods); |
43 | 43 | $presentValue = Functions::flattenSingleValue($presentValue); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $start, |
103 | 103 | $end, |
104 | 104 | $type = FinancialConstants::PAYMENT_END_OF_PERIOD |
105 | - ): string|float|int { |
|
105 | + ): string | float | int { |
|
106 | 106 | $rate = Functions::flattenSingleValue($rate); |
107 | 107 | $periods = Functions::flattenSingleValue($periods); |
108 | 108 | $presentValue = Functions::flattenSingleValue($presentValue); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $presentValue, |
30 | 30 | $futureValue = 0, |
31 | 31 | $type = FinancialConstants::PAYMENT_END_OF_PERIOD |
32 | - ): string|float { |
|
32 | + ): string | float { |
|
33 | 33 | $interestRate = Functions::flattenSingleValue($interestRate); |
34 | 34 | $numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods); |
35 | 35 | $presentValue = Functions::flattenSingleValue($presentValue); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $presentValue, |
78 | 78 | $futureValue = 0, |
79 | 79 | $type = FinancialConstants::PAYMENT_END_OF_PERIOD |
80 | - ): string|float { |
|
80 | + ): string | float { |
|
81 | 81 | $interestRate = Functions::flattenSingleValue($interestRate); |
82 | 82 | $period = Functions::flattenSingleValue($period); |
83 | 83 | $numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $presentValue, |
38 | 38 | $futureValue = 0, |
39 | 39 | $type = FinancialConstants::PAYMENT_END_OF_PERIOD |
40 | - ): string|float { |
|
40 | + ): string | float { |
|
41 | 41 | $interestRate = Functions::flattenSingleValue($interestRate); |
42 | 42 | $period = Functions::flattenSingleValue($period); |
43 | 43 | $numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @param mixed $numberOfPeriods is the number of payments for the annuity |
88 | 88 | * @param mixed $principleRemaining is the loan amount or present value of the payments |
89 | 89 | */ |
90 | - public static function schedulePayment($interestRate, $period, $numberOfPeriods, $principleRemaining): string|float |
|
90 | + public static function schedulePayment($interestRate, $period, $numberOfPeriods, $principleRemaining): string | float |
|
91 | 91 | { |
92 | 92 | $interestRate = Functions::flattenSingleValue($interestRate); |
93 | 93 | $period = Functions::flattenSingleValue($period); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $futureValue = 0.0, |
157 | 157 | $type = FinancialConstants::PAYMENT_END_OF_PERIOD, |
158 | 158 | $guess = 0.1 |
159 | - ): string|float { |
|
159 | + ): string | float { |
|
160 | 160 | $numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods); |
161 | 161 | $payment = Functions::flattenSingleValue($payment); |
162 | 162 | $presentValue = Functions::flattenSingleValue($presentValue); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | return $close ? $rate : ExcelError::NAN(); |
194 | 194 | } |
195 | 195 | |
196 | - private static function rateNextGuess(float $rate, int $numberOfPeriods, float $payment, float $presentValue, float $futureValue, int $type): string|float |
|
196 | + private static function rateNextGuess(float $rate, int $numberOfPeriods, float $payment, float $presentValue, float $futureValue, int $type): string | float |
|
197 | 197 | { |
198 | 198 | if ($rate == 0.0) { |
199 | 199 | return ExcelError::NAN(); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $payment = 0.0, |
36 | 36 | $presentValue = 0.0, |
37 | 37 | $type = FinancialConstants::PAYMENT_END_OF_PERIOD |
38 | - ): string|float { |
|
38 | + ): string | float { |
|
39 | 39 | $rate = Functions::flattenSingleValue($rate); |
40 | 40 | $numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods); |
41 | 41 | $payment = ($payment === null) ? 0.0 : Functions::flattenSingleValue($payment); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $payment = 0.0, |
75 | 75 | $futureValue = 0.0, |
76 | 76 | $type = FinancialConstants::PAYMENT_END_OF_PERIOD |
77 | - ): string|float { |
|
77 | + ): string | float { |
|
78 | 78 | $rate = Functions::flattenSingleValue($rate); |
79 | 79 | $numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods); |
80 | 80 | $payment = ($payment === null) ? 0.0 : Functions::flattenSingleValue($payment); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | float $presentValue, |
181 | 181 | float $futureValue, |
182 | 182 | int $type |
183 | - ): string|float { |
|
183 | + ): string | float { |
|
184 | 184 | if ($rate != 0.0) { |
185 | 185 | if ($presentValue == 0.0) { |
186 | 186 | return ExcelError::NAN(); |