Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 400 and 401]

   1  <?php
   2  
   3  namespace PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities;
   4  
   5  use PhpOffice\PhpSpreadsheet\Calculation\Exception;
   6  use PhpOffice\PhpSpreadsheet\Calculation\Financial\FinancialValidations;
   7  use 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  }