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 / Securities / SecurityValidations.php

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

43 lines 1023 B
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\Securities;
4
5 use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Exception;
6 use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Financial\FinancialValidations;
7 use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
8
9 class SecurityValidations extends FinancialValidations
10 {
11 /**
12 * @param mixed $issue
13 */
14 public static function validateIssueDate($issue): float
15 {
16 return self::validateDate($issue);
17 }
18
19 /**
20 * @param mixed $settlement
21 * @param mixed $maturity
22 */
23 public static function validateSecurityPeriod($settlement, $maturity): void
24 {
25 if ($settlement >= $maturity) {
26 throw new Exception(ExcelError::NAN());
27 }
28 }
29
30 /**
31 * @param mixed $redemption
32 */
33 public static function validateRedemption($redemption): float
34 {
35 $redemption = self::validateFloat($redemption);
36 if ($redemption <= 0.0) {
37 throw new Exception(ExcelError::NAN());
38 }
39
40 return $redemption;
41 }
42 }
43