PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
tablepress / libraries / vendor / PhpSpreadsheet / Calculation / Financial / CashFlow / CashFlowValidations.php

CashFlowValidations.php in TablePress – Tables in WordPress made easy 3.4, at libraries/vendor/PhpSpreadsheet/Calculation/Financial/CashFlow/CashFlowValidations.php

54 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TablePress\PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow;
4
5 use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Exception;
6 use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Financial\Constants as FinancialConstants;
7 use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Financial\FinancialValidations;
8 use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
9
10 class CashFlowValidations extends FinancialValidations
11 {
12 /**
13 * @param mixed $rate
14 */
15 public static function validateRate($rate): float
16 {
17 $rate = self::validateFloat($rate);
18
19 return $rate;
20 }
21
22 /**
23 * @param mixed $type
24 */
25 public static function validatePeriodType($type): int
26 {
27 $rate = self::validateInt($type);
28 if (
29 $type !== FinancialConstants::PAYMENT_END_OF_PERIOD
30 && $type !== FinancialConstants::PAYMENT_BEGINNING_OF_PERIOD
31 ) {
32 throw new Exception(ExcelError::NAN());
33 }
34
35 return $rate;
36 }
37
38 /**
39 * @param mixed $presentValue
40 */
41 public static function validatePresentValue($presentValue): float
42 {
43 return self::validateFloat($presentValue);
44 }
45
46 /**
47 * @param mixed $futureValue
48 */
49 public static function validateFutureValue($futureValue): float
50 {
51 return self::validateFloat($futureValue);
52 }
53 }
54