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 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 402] [Versions 401 and 403]

   1  <?php
   2  
   3  namespace PhpOffice\PhpSpreadsheet\Calculation;
   4  
   5  use PhpOffice\PhpSpreadsheet\Calculation\Financial\Amortization;
   6  use PhpOffice\PhpSpreadsheet\Calculation\Financial\Coupons;
   7  use PhpOffice\PhpSpreadsheet\Calculation\Financial\Depreciation;
   8  use PhpOffice\PhpSpreadsheet\Calculation\Financial\Dollar;
   9  use PhpOffice\PhpSpreadsheet\Calculation\Financial\InterestRate;
  10  use PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities;
  11  use PhpOffice\PhpSpreadsheet\Calculation\Financial\TreasuryBill;
  12  
  13  /**
  14   * @deprecated 1.18.0
  15   */
  16  class Financial
  17  {
  18      const FINANCIAL_MAX_ITERATIONS = 128;
  19  
  20      const FINANCIAL_PRECISION = 1.0e-08;
  21  
  22      /**
  23       * ACCRINT.
  24       *
  25       * Returns the accrued interest for a security that pays periodic interest.
  26       *
  27       * Excel Function:
  28       *        ACCRINT(issue,firstinterest,settlement,rate,par,frequency[,basis][,calc_method])
  29       *
  30       * @Deprecated 1.18.0
  31       *
  32       * @see Financial\Securities\AccruedInterest::periodic()
  33       *      Use the periodic() method in the Financial\Securities\AccruedInterest class instead
  34       *
  35       * @param mixed $issue the security's issue date
  36       * @param mixed $firstInterest the security's first interest date
  37       * @param mixed $settlement The security's settlement date.
  38       *                              The security settlement date is the date after the issue date
  39       *                                  when the security is traded to the buyer.
  40       * @param mixed $rate the security's annual coupon rate
  41       * @param mixed $parValue The security's par value.
  42       *                            If you omit par, ACCRINT uses $1,000.
  43       * @param mixed $frequency The number of coupon payments per year.
  44       *                             Valid frequency values are:
  45       *                               1    Annual
  46       *                               2    Semi-Annual
  47       *                               4    Quarterly
  48       * @param mixed $basis The type of day count to use.
  49       *                         0 or omitted    US (NASD) 30/360
  50       *                         1               Actual/actual
  51       *                         2               Actual/360
  52       *                         3               Actual/365
  53       *                         4               European 30/360
  54       * @param mixed $calcMethod
  55       *                          If true, use Issue to Settlement
  56       *                          If false, use FirstInterest to Settlement
  57       *
  58       * @return float|string Result, or a string containing an error
  59       */
  60      public static function ACCRINT(
  61          $issue,
  62          $firstInterest,
  63          $settlement,
  64          $rate,
  65          $parValue = 1000,
  66          $frequency = 1,
  67          $basis = 0,
  68          $calcMethod = true
  69      ) {
  70          return Securities\AccruedInterest::periodic(
  71              $issue,
  72              $firstInterest,
  73              $settlement,
  74              $rate,
  75              $parValue,
  76              $frequency,
  77              $basis,
  78              $calcMethod
  79          );
  80      }
  81  
  82      /**
  83       * ACCRINTM.
  84       *
  85       * Returns the accrued interest for a security that pays interest at maturity.
  86       *
  87       * Excel Function:
  88       *        ACCRINTM(issue,settlement,rate[,par[,basis]])
  89       *
  90       * @Deprecated 1.18.0
  91       *
  92       * @see Financial\Securities\AccruedInterest::atMaturity()
  93       *      Use the atMaturity() method in the Financial\Securities\AccruedInterest class instead
  94       *
  95       * @param mixed $issue The security's issue date
  96       * @param mixed $settlement The security's settlement (or maturity) date
  97       * @param mixed $rate The security's annual coupon rate
  98       * @param mixed $parValue The security's par value.
  99       *                            If you omit par, ACCRINT uses $1,000.
 100       * @param mixed $basis The type of day count to use.
 101       *                            0 or omitted    US (NASD) 30/360
 102       *                            1               Actual/actual
 103       *                            2               Actual/360
 104       *                            3               Actual/365
 105       *                            4               European 30/360
 106       *
 107       * @return float|string Result, or a string containing an error
 108       */
 109      public static function ACCRINTM($issue, $settlement, $rate, $parValue = 1000, $basis = 0)
 110      {
 111          return Securities\AccruedInterest::atMaturity($issue, $settlement, $rate, $parValue, $basis);
 112      }
 113  
 114      /**
 115       * AMORDEGRC.
 116       *
 117       * Returns the depreciation for each accounting period.
 118       * This function is provided for the French accounting system. If an asset is purchased in
 119       * the middle of the accounting period, the prorated depreciation is taken into account.
 120       * The function is similar to AMORLINC, except that a depreciation coefficient is applied in
 121       * the calculation depending on the life of the assets.
 122       * This function will return the depreciation until the last period of the life of the assets
 123       * or until the cumulated value of depreciation is greater than the cost of the assets minus
 124       * the salvage value.
 125       *
 126       * Excel Function:
 127       *        AMORDEGRC(cost,purchased,firstPeriod,salvage,period,rate[,basis])
 128       *
 129       * @Deprecated 1.18.0
 130       *
 131       * @see Financial\Amortization::AMORDEGRC()
 132       *      Use the AMORDEGRC() method in the Financial\Amortization class instead
 133       *
 134       * @param float $cost The cost of the asset
 135       * @param mixed $purchased Date of the purchase of the asset
 136       * @param mixed $firstPeriod Date of the end of the first period
 137       * @param mixed $salvage The salvage value at the end of the life of the asset
 138       * @param float $period The period
 139       * @param float $rate Rate of depreciation
 140       * @param int $basis The type of day count to use.
 141       *                       0 or omitted    US (NASD) 30/360
 142       *                       1                Actual/actual
 143       *                       2                Actual/360
 144       *                       3                Actual/365
 145       *                       4                European 30/360
 146       *
 147       * @return float|string (string containing the error type if there is an error)
 148       */
 149      public static function AMORDEGRC($cost, $purchased, $firstPeriod, $salvage, $period, $rate, $basis = 0)
 150      {
 151          return Amortization::AMORDEGRC($cost, $purchased, $firstPeriod, $salvage, $period, $rate, $basis);
 152      }
 153  
 154      /**
 155       * AMORLINC.
 156       *
 157       * Returns the depreciation for each accounting period.
 158       * This function is provided for the French accounting system. If an asset is purchased in
 159       * the middle of the accounting period, the prorated depreciation is taken into account.
 160       *
 161       * Excel Function:
 162       *        AMORLINC(cost,purchased,firstPeriod,salvage,period,rate[,basis])
 163       *
 164       * @Deprecated 1.18.0
 165       *
 166       * @see Financial\Amortization::AMORLINC()
 167       *      Use the AMORLINC() method in the Financial\Amortization class instead
 168       *
 169       * @param float $cost The cost of the asset
 170       * @param mixed $purchased Date of the purchase of the asset
 171       * @param mixed $firstPeriod Date of the end of the first period
 172       * @param mixed $salvage The salvage value at the end of the life of the asset
 173       * @param float $period The period
 174       * @param float $rate Rate of depreciation
 175       * @param int $basis The type of day count to use.
 176       *                       0 or omitted    US (NASD) 30/360
 177       *                       1               Actual/actual
 178       *                       2               Actual/360
 179       *                       3               Actual/365
 180       *                       4               European 30/360
 181       *
 182       * @return float|string (string containing the error type if there is an error)
 183       */
 184      public static function AMORLINC($cost, $purchased, $firstPeriod, $salvage, $period, $rate, $basis = 0)
 185      {
 186          return Amortization::AMORLINC($cost, $purchased, $firstPeriod, $salvage, $period, $rate, $basis);
 187      }
 188  
 189      /**
 190       * COUPDAYBS.
 191       *
 192       * Returns the number of days from the beginning of the coupon period to the settlement date.
 193       *
 194       * Excel Function:
 195       *        COUPDAYBS(settlement,maturity,frequency[,basis])
 196       *
 197       * @Deprecated 1.18.0
 198       *
 199       * @see Financial\Coupons::COUPDAYBS()
 200       *      Use the COUPDAYBS() method in the Financial\Coupons class instead
 201       *
 202       * @param mixed $settlement The security's settlement date.
 203       *                                The security settlement date is the date after the issue
 204       *                                date when the security is traded to the buyer.
 205       * @param mixed $maturity The security's maturity date.
 206       *                                The maturity date is the date when the security expires.
 207       * @param int $frequency the number of coupon payments per year.
 208       *                                    Valid frequency values are:
 209       *                                        1    Annual
 210       *                                        2    Semi-Annual
 211       *                                        4    Quarterly
 212       * @param int $basis The type of day count to use.
 213       *                                        0 or omitted    US (NASD) 30/360
 214       *                                        1                Actual/actual
 215       *                                        2                Actual/360
 216       *                                        3                Actual/365
 217       *                                        4                European 30/360
 218       *
 219       * @return float|string
 220       */
 221      public static function COUPDAYBS($settlement, $maturity, $frequency, $basis = 0)
 222      {
 223          return Coupons::COUPDAYBS($settlement, $maturity, $frequency, $basis);
 224      }
 225  
 226      /**
 227       * COUPDAYS.
 228       *
 229       * Returns the number of days in the coupon period that contains the settlement date.
 230       *
 231       * Excel Function:
 232       *        COUPDAYS(settlement,maturity,frequency[,basis])
 233       *
 234       * @Deprecated 1.18.0
 235       *
 236       * @see Financial\Coupons::COUPDAYS()
 237       *      Use the COUPDAYS() method in the Financial\Coupons class instead
 238       *
 239       * @param mixed $settlement The security's settlement date.
 240       *                                The security settlement date is the date after the issue
 241       *                                date when the security is traded to the buyer.
 242       * @param mixed $maturity The security's maturity date.
 243       *                                The maturity date is the date when the security expires.
 244       * @param mixed $frequency the number of coupon payments per year.
 245       *                                    Valid frequency values are:
 246       *                                        1    Annual
 247       *                                        2    Semi-Annual
 248       *                                        4    Quarterly
 249       * @param int $basis The type of day count to use.
 250       *                                        0 or omitted    US (NASD) 30/360
 251       *                                        1                Actual/actual
 252       *                                        2                Actual/360
 253       *                                        3                Actual/365
 254       *                                        4                European 30/360
 255       *
 256       * @return float|string
 257       */
 258      public static function COUPDAYS($settlement, $maturity, $frequency, $basis = 0)
 259      {
 260          return Coupons::COUPDAYS($settlement, $maturity, $frequency, $basis);
 261      }
 262  
 263      /**
 264       * COUPDAYSNC.
 265       *
 266       * Returns the number of days from the settlement date to the next coupon date.
 267       *
 268       * Excel Function:
 269       *        COUPDAYSNC(settlement,maturity,frequency[,basis])
 270       *
 271       * @Deprecated 1.18.0
 272       *
 273       * @see Financial\Coupons::COUPDAYSNC()
 274       *      Use the COUPDAYSNC() method in the Financial\Coupons class instead
 275       *
 276       * @param mixed $settlement The security's settlement date.
 277       *                                The security settlement date is the date after the issue
 278       *                                date when the security is traded to the buyer.
 279       * @param mixed $maturity The security's maturity date.
 280       *                                The maturity date is the date when the security expires.
 281       * @param mixed $frequency the number of coupon payments per year.
 282       *                                    Valid frequency values are:
 283       *                                        1    Annual
 284       *                                        2    Semi-Annual
 285       *                                        4    Quarterly
 286       * @param int $basis The type of day count to use.
 287       *                                        0 or omitted    US (NASD) 30/360
 288       *                                        1                Actual/actual
 289       *                                        2                Actual/360
 290       *                                        3                Actual/365
 291       *                                        4                European 30/360
 292       *
 293       * @return float|string
 294       */
 295      public static function COUPDAYSNC($settlement, $maturity, $frequency, $basis = 0)
 296      {
 297          return Coupons::COUPDAYSNC($settlement, $maturity, $frequency, $basis);
 298      }
 299  
 300      /**
 301       * COUPNCD.
 302       *
 303       * Returns the next coupon date after the settlement date.
 304       *
 305       * Excel Function:
 306       *        COUPNCD(settlement,maturity,frequency[,basis])
 307       *
 308       * @Deprecated 1.18.0
 309       *
 310       * @see Financial\Coupons::COUPNCD()
 311       *      Use the COUPNCD() method in the Financial\Coupons class instead
 312       *
 313       * @param mixed $settlement The security's settlement date.
 314       *                                The security settlement date is the date after the issue
 315       *                                date when the security is traded to the buyer.
 316       * @param mixed $maturity The security's maturity date.
 317       *                                The maturity date is the date when the security expires.
 318       * @param mixed $frequency the number of coupon payments per year.
 319       *                                    Valid frequency values are:
 320       *                                        1    Annual
 321       *                                        2    Semi-Annual
 322       *                                        4    Quarterly
 323       * @param int $basis The type of day count to use.
 324       *                                        0 or omitted    US (NASD) 30/360
 325       *                                        1                Actual/actual
 326       *                                        2                Actual/360
 327       *                                        3                Actual/365
 328       *                                        4                European 30/360
 329       *
 330       * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
 331       *                        depending on the value of the ReturnDateType flag
 332       */
 333      public static function COUPNCD($settlement, $maturity, $frequency, $basis = 0)
 334      {
 335          return Coupons::COUPNCD($settlement, $maturity, $frequency, $basis);
 336      }
 337  
 338      /**
 339       * COUPNUM.
 340       *
 341       * Returns the number of coupons payable between the settlement date and maturity date,
 342       * rounded up to the nearest whole coupon.
 343       *
 344       * Excel Function:
 345       *        COUPNUM(settlement,maturity,frequency[,basis])
 346       *
 347       * @Deprecated 1.18.0
 348       *
 349       * @see Financial\Coupons::COUPNUM()
 350       *      Use the COUPNUM() method in the Financial\Coupons class instead
 351       *
 352       * @param mixed $settlement The security's settlement date.
 353       *                                The security settlement date is the date after the issue
 354       *                                date when the security is traded to the buyer.
 355       * @param mixed $maturity The security's maturity date.
 356       *                                The maturity date is the date when the security expires.
 357       * @param mixed $frequency the number of coupon payments per year.
 358       *                                    Valid frequency values are:
 359       *                                        1    Annual
 360       *                                        2    Semi-Annual
 361       *                                        4    Quarterly
 362       * @param int $basis The type of day count to use.
 363       *                                        0 or omitted    US (NASD) 30/360
 364       *                                        1                Actual/actual
 365       *                                        2                Actual/360
 366       *                                        3                Actual/365
 367       *                                        4                European 30/360
 368       *
 369       * @return int|string
 370       */
 371      public static function COUPNUM($settlement, $maturity, $frequency, $basis = 0)
 372      {
 373          return Coupons::COUPNUM($settlement, $maturity, $frequency, $basis);
 374      }
 375  
 376      /**
 377       * COUPPCD.
 378       *
 379       * Returns the previous coupon date before the settlement date.
 380       *
 381       * Excel Function:
 382       *        COUPPCD(settlement,maturity,frequency[,basis])
 383       *
 384       * @Deprecated 1.18.0
 385       *
 386       * @see Financial\Coupons::COUPPCD()
 387       *      Use the COUPPCD() method in the Financial\Coupons class instead
 388       *
 389       * @param mixed $settlement The security's settlement date.
 390       *                                The security settlement date is the date after the issue
 391       *                                date when the security is traded to the buyer.
 392       * @param mixed $maturity The security's maturity date.
 393       *                                The maturity date is the date when the security expires.
 394       * @param mixed $frequency the number of coupon payments per year.
 395       *                                    Valid frequency values are:
 396       *                                        1    Annual
 397       *                                        2    Semi-Annual
 398       *                                        4    Quarterly
 399       * @param int $basis The type of day count to use.
 400       *                                        0 or omitted    US (NASD) 30/360
 401       *                                        1                Actual/actual
 402       *                                        2                Actual/360
 403       *                                        3                Actual/365
 404       *                                        4                European 30/360
 405       *
 406       * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
 407       *                        depending on the value of the ReturnDateType flag
 408       */
 409      public static function COUPPCD($settlement, $maturity, $frequency, $basis = 0)
 410      {
 411          return Coupons::COUPPCD($settlement, $maturity, $frequency, $basis);
 412      }
 413  
 414      /**
 415       * CUMIPMT.
 416       *
 417       * Returns the cumulative interest paid on a loan between the start and end periods.
 418       *
 419       * Excel Function:
 420       *        CUMIPMT(rate,nper,pv,start,end[,type])
 421       *
 422       * @Deprecated 1.18.0
 423       *
 424       * @see Financial\CashFlow\Constant\Periodic\Cumulative::interest()
 425       *      Use the interest() method in the Financial\CashFlow\Constant\Periodic\Cumulative class instead
 426       *
 427       * @param float $rate The Interest rate
 428       * @param int $nper The total number of payment periods
 429       * @param float $pv Present Value
 430       * @param int $start The first period in the calculation.
 431       *                       Payment periods are numbered beginning with 1.
 432       * @param int $end the last period in the calculation
 433       * @param int $type A number 0 or 1 and indicates when payments are due:
 434       *                    0 or omitted    At the end of the period.
 435       *                    1               At the beginning of the period.
 436       *
 437       * @return float|string
 438       */
 439      public static function CUMIPMT($rate, $nper, $pv, $start, $end, $type = 0)
 440      {
 441          return Financial\CashFlow\Constant\Periodic\Cumulative::interest($rate, $nper, $pv, $start, $end, $type);
 442      }
 443  
 444      /**
 445       * CUMPRINC.
 446       *
 447       * Returns the cumulative principal paid on a loan between the start and end periods.
 448       *
 449       * Excel Function:
 450       *        CUMPRINC(rate,nper,pv,start,end[,type])
 451       *
 452       * @Deprecated 1.18.0
 453       *
 454       * @see Financial\CashFlow\Constant\Periodic\Cumulative::principal()
 455       *      Use the principal() method in the Financial\CashFlow\Constant\Periodic\Cumulative class instead
 456       *
 457       * @param float $rate The Interest rate
 458       * @param int $nper The total number of payment periods
 459       * @param float $pv Present Value
 460       * @param int $start The first period in the calculation.
 461       *                       Payment periods are numbered beginning with 1.
 462       * @param int $end the last period in the calculation
 463       * @param int $type A number 0 or 1 and indicates when payments are due:
 464       *                    0 or omitted    At the end of the period.
 465       *                    1               At the beginning of the period.
 466       *
 467       * @return float|string
 468       */
 469      public static function CUMPRINC($rate, $nper, $pv, $start, $end, $type = 0)
 470      {
 471          return Financial\CashFlow\Constant\Periodic\Cumulative::principal($rate, $nper, $pv, $start, $end, $type);
 472      }
 473  
 474      /**
 475       * DB.
 476       *
 477       * Returns the depreciation of an asset for a specified period using the
 478       * fixed-declining balance method.
 479       * This form of depreciation is used if you want to get a higher depreciation value
 480       * at the beginning of the depreciation (as opposed to linear depreciation). The
 481       * depreciation value is reduced with every depreciation period by the depreciation
 482       * already deducted from the initial cost.
 483       *
 484       * Excel Function:
 485       *        DB(cost,salvage,life,period[,month])
 486       *
 487       * @Deprecated 1.18.0
 488       *
 489       * @see Financial\Depreciation::DB()
 490       *      Use the DB() method in the Financial\Depreciation class instead
 491       *
 492       * @param float $cost Initial cost of the asset
 493       * @param float $salvage Value at the end of the depreciation.
 494       *                                (Sometimes called the salvage value of the asset)
 495       * @param int $life Number of periods over which the asset is depreciated.
 496       *                                (Sometimes called the useful life of the asset)
 497       * @param int $period The period for which you want to calculate the
 498       *                                depreciation. Period must use the same units as life.
 499       * @param int $month Number of months in the first year. If month is omitted,
 500       *                                it defaults to 12.
 501       *
 502       * @return float|string
 503       */
 504      public static function DB($cost, $salvage, $life, $period, $month = 12)
 505      {
 506          return Depreciation::DB($cost, $salvage, $life, $period, $month);
 507      }
 508  
 509      /**
 510       * DDB.
 511       *
 512       * Returns the depreciation of an asset for a specified period using the
 513       * double-declining balance method or some other method you specify.
 514       *
 515       * Excel Function:
 516       *        DDB(cost,salvage,life,period[,factor])
 517       *
 518       * @Deprecated 1.18.0
 519       *
 520       * @see Financial\Depreciation::DDB()
 521       *      Use the DDB() method in the Financial\Depreciation class instead
 522       *
 523       * @param float $cost Initial cost of the asset
 524       * @param float $salvage Value at the end of the depreciation.
 525       *                                (Sometimes called the salvage value of the asset)
 526       * @param int $life Number of periods over which the asset is depreciated.
 527       *                                (Sometimes called the useful life of the asset)
 528       * @param int $period The period for which you want to calculate the
 529       *                                depreciation. Period must use the same units as life.
 530       * @param float $factor The rate at which the balance declines.
 531       *                                If factor is omitted, it is assumed to be 2 (the
 532       *                                double-declining balance method).
 533       *
 534       * @return float|string
 535       */
 536      public static function DDB($cost, $salvage, $life, $period, $factor = 2.0)
 537      {
 538          return Depreciation::DDB($cost, $salvage, $life, $period, $factor);
 539      }
 540  
 541      /**
 542       * DISC.
 543       *
 544       * Returns the discount rate for a security.
 545       *
 546       * Excel Function:
 547       *        DISC(settlement,maturity,price,redemption[,basis])
 548       *
 549       * @Deprecated 1.18.0
 550       *
 551       * @see Financial\Securities\Rates::discount()
 552       *      Use the discount() method in the Financial\Securities\Rates class instead
 553       *
 554       * @param mixed $settlement The security's settlement date.
 555       *                                The security settlement date is the date after the issue
 556       *                                date when the security is traded to the buyer.
 557       * @param mixed $maturity The security's maturity date.
 558       *                                The maturity date is the date when the security expires.
 559       * @param int $price The security's price per $100 face value
 560       * @param int $redemption The security's redemption value per $100 face value
 561       * @param int $basis The type of day count to use.
 562       *                                        0 or omitted    US (NASD) 30/360
 563       *                                        1                Actual/actual
 564       *                                        2                Actual/360
 565       *                                        3                Actual/365
 566       *                                        4                European 30/360
 567       *
 568       * @return float|string
 569       */
 570      public static function DISC($settlement, $maturity, $price, $redemption, $basis = 0)
 571      {
 572          return Financial\Securities\Rates::discount($settlement, $maturity, $price, $redemption, $basis);
 573      }
 574  
 575      /**
 576       * DOLLARDE.
 577       *
 578       * Converts a dollar price expressed as an integer part and a fraction
 579       *        part into a dollar price expressed as a decimal number.
 580       * Fractional dollar numbers are sometimes used for security prices.
 581       *
 582       * Excel Function:
 583       *        DOLLARDE(fractional_dollar,fraction)
 584       *
 585       * @Deprecated 1.18.0
 586       *
 587       * @see Financial\Dollar::decimal()
 588       *      Use the decimal() method in the Financial\Dollar class instead
 589       *
 590       * @param array|float $fractional_dollar Fractional Dollar
 591       * @param array|int $fraction Fraction
 592       *
 593       * @return array|float|string
 594       */
 595      public static function DOLLARDE($fractional_dollar = null, $fraction = 0)
 596      {
 597          return Dollar::decimal($fractional_dollar, $fraction);
 598      }
 599  
 600      /**
 601       * DOLLARFR.
 602       *
 603       * Converts a dollar price expressed as a decimal number into a dollar price
 604       *        expressed as a fraction.
 605       * Fractional dollar numbers are sometimes used for security prices.
 606       *
 607       * Excel Function:
 608       *        DOLLARFR(decimal_dollar,fraction)
 609       *
 610       * @Deprecated 1.18.0
 611       *
 612       * @see Financial\Dollar::fractional()
 613       *      Use the fractional() method in the Financial\Dollar class instead
 614       *
 615       * @param array|float $decimal_dollar Decimal Dollar
 616       * @param array|int $fraction Fraction
 617       *
 618       * @return array|float|string
 619       */
 620      public static function DOLLARFR($decimal_dollar = null, $fraction = 0)
 621      {
 622          return Dollar::fractional($decimal_dollar, $fraction);
 623      }
 624  
 625      /**
 626       * EFFECT.
 627       *
 628       * Returns the effective interest rate given the nominal rate and the number of
 629       *        compounding payments per year.
 630       *
 631       * Excel Function:
 632       *        EFFECT(nominal_rate,npery)
 633       *
 634       * @Deprecated 1.18.0
 635       *
 636       * @see Financial\InterestRate::effective()
 637       *      Use the effective() method in the Financial\InterestRate class instead
 638       *
 639       * @param float $nominalRate Nominal interest rate
 640       * @param int $periodsPerYear Number of compounding payments per year
 641       *
 642       * @return float|string
 643       */
 644      public static function EFFECT($nominalRate = 0, $periodsPerYear = 0)
 645      {
 646          return Financial\InterestRate::effective($nominalRate, $periodsPerYear);
 647      }
 648  
 649      /**
 650       * FV.
 651       *
 652       * Returns the Future Value of a cash flow with constant payments and interest rate (annuities).
 653       *
 654       * Excel Function:
 655       *        FV(rate,nper,pmt[,pv[,type]])
 656       *
 657       * @Deprecated 1.18.0
 658       *
 659       * @see Financial\CashFlow\Constant\Periodic::futureValue()
 660       *      Use the futureValue() method in the Financial\CashFlow\Constant\Periodic class instead
 661       *
 662       * @param float $rate The interest rate per period
 663       * @param int $nper Total number of payment periods in an annuity
 664       * @param float $pmt The payment made each period: it cannot change over the
 665       *                            life of the annuity. Typically, pmt contains principal
 666       *                            and interest but no other fees or taxes.
 667       * @param float $pv present Value, or the lump-sum amount that a series of
 668       *                            future payments is worth right now
 669       * @param int $type A number 0 or 1 and indicates when payments are due:
 670       *                                0 or omitted    At the end of the period.
 671       *                                1                At the beginning of the period.
 672       *
 673       * @return float|string
 674       */
 675      public static function FV($rate = 0, $nper = 0, $pmt = 0, $pv = 0, $type = 0)
 676      {
 677          return Financial\CashFlow\Constant\Periodic::futureValue($rate, $nper, $pmt, $pv, $type);
 678      }
 679  
 680      /**
 681       * FVSCHEDULE.
 682       *
 683       * Returns the future value of an initial principal after applying a series of compound interest rates.
 684       * Use FVSCHEDULE to calculate the future value of an investment with a variable or adjustable rate.
 685       *
 686       * Excel Function:
 687       *        FVSCHEDULE(principal,schedule)
 688       *
 689       * @Deprecated 1.18.0
 690       *
 691       * @see Financial\CashFlow\Single::futureValue()
 692       *      Use the futureValue() method in the Financial\CashFlow\Single class instead
 693       *
 694       * @param float $principal the present value
 695       * @param float[] $schedule an array of interest rates to apply
 696       *
 697       * @return float|string
 698       */
 699      public static function FVSCHEDULE($principal, $schedule)
 700      {
 701          return Financial\CashFlow\Single::futureValue($principal, $schedule);
 702      }
 703  
 704      /**
 705       * INTRATE.
 706       *
 707       * Returns the interest rate for a fully invested security.
 708       *
 709       * Excel Function:
 710       *        INTRATE(settlement,maturity,investment,redemption[,basis])
 711       *
 712       * @Deprecated 1.18.0
 713       *
 714       * @see Financial\Securities\Rates::interest()
 715       *      Use the interest() method in the Financial\Securities\Rates class instead
 716       *
 717       * @param mixed $settlement The security's settlement date.
 718       *                              The security settlement date is the date after the issue date when the security
 719       *                                  is traded to the buyer.
 720       * @param mixed $maturity The security's maturity date.
 721       *                            The maturity date is the date when the security expires.
 722       * @param int $investment the amount invested in the security
 723       * @param int $redemption the amount to be received at maturity
 724       * @param int $basis The type of day count to use.
 725       *                       0 or omitted    US (NASD) 30/360
 726       *                       1               Actual/actual
 727       *                       2               Actual/360
 728       *                       3               Actual/365
 729       *                       4               European 30/360
 730       *
 731       * @return float|string
 732       */
 733      public static function INTRATE($settlement, $maturity, $investment, $redemption, $basis = 0)
 734      {
 735          return Financial\Securities\Rates::interest($settlement, $maturity, $investment, $redemption, $basis);
 736      }
 737  
 738      /**
 739       * IPMT.
 740       *
 741       * Returns the interest payment for a given period for an investment based on periodic, constant payments
 742       *         and a constant interest rate.
 743       *
 744       * Excel Function:
 745       *        IPMT(rate,per,nper,pv[,fv][,type])
 746       *
 747       * @Deprecated 1.18.0
 748       *
 749       * @see Financial\CashFlow\Constant\Periodic\Interest::payment()
 750       *      Use the payment() method in the Financial\CashFlow\Constant\Periodic class instead
 751       *
 752       * @param float $rate Interest rate per period
 753       * @param int $per Period for which we want to find the interest
 754       * @param int $nper Number of periods
 755       * @param float $pv Present Value
 756       * @param float $fv Future Value
 757       * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
 758       *
 759       * @return float|string
 760       */
 761      public static function IPMT($rate, $per, $nper, $pv, $fv = 0, $type = 0)
 762      {
 763          return Financial\CashFlow\Constant\Periodic\Interest::payment($rate, $per, $nper, $pv, $fv, $type);
 764      }
 765  
 766      /**
 767       * IRR.
 768       *
 769       * Returns the internal rate of return for a series of cash flows represented by the numbers in values.
 770       * These cash flows do not have to be even, as they would be for an annuity. However, the cash flows must occur
 771       * at regular intervals, such as monthly or annually. The internal rate of return is the interest rate received
 772       * for an investment consisting of payments (negative values) and income (positive values) that occur at regular
 773       * periods.
 774       *
 775       * Excel Function:
 776       *        IRR(values[,guess])
 777       *
 778       * @Deprecated 1.18.0
 779       *
 780       * @see Financial\CashFlow\Variable\Periodic::rate()
 781       *      Use the rate() method in the Financial\CashFlow\Variable\Periodic class instead
 782       *
 783       * @param mixed $values An array or a reference to cells that contain numbers for which you want
 784       *                                    to calculate the internal rate of return.
 785       *                                Values must contain at least one positive value and one negative value to
 786       *                                    calculate the internal rate of return.
 787       * @param mixed $guess A number that you guess is close to the result of IRR
 788       *
 789       * @return float|string
 790       */
 791      public static function IRR($values, $guess = 0.1)
 792      {
 793          return Financial\CashFlow\Variable\Periodic::rate($values, $guess);
 794      }
 795  
 796      /**
 797       * ISPMT.
 798       *
 799       * Returns the interest payment for an investment based on an interest rate and a constant payment schedule.
 800       *
 801       * Excel Function:
 802       *     =ISPMT(interest_rate, period, number_payments, pv)
 803       *
 804       * @Deprecated 1.18.0
 805       *
 806       * @see Financial\CashFlow\Constant\Periodic\Interest::schedulePayment()
 807       *      Use the schedulePayment() method in the Financial\CashFlow\Constant\Periodic class instead
 808       *
 809       * interest_rate is the interest rate for the investment
 810       *
 811       * period is the period to calculate the interest rate.  It must be betweeen 1 and number_payments.
 812       *
 813       * number_payments is the number of payments for the annuity
 814       *
 815       * pv is the loan amount or present value of the payments
 816       */
 817      public static function ISPMT(...$args)
 818      {
 819          return Financial\CashFlow\Constant\Periodic\Interest::schedulePayment(...$args);
 820      }
 821  
 822      /**
 823       * MIRR.
 824       *
 825       * Returns the modified internal rate of return for a series of periodic cash flows. MIRR considers both
 826       *        the cost of the investment and the interest received on reinvestment of cash.
 827       *
 828       * Excel Function:
 829       *        MIRR(values,finance_rate, reinvestment_rate)
 830       *
 831       * @Deprecated 1.18.0
 832       *
 833       * @see Financial\CashFlow\Variable\Periodic::modifiedRate()
 834       *      Use the modifiedRate() method in the Financial\CashFlow\Variable\Periodic class instead
 835       *
 836       * @param mixed $values An array or a reference to cells that contain a series of payments and
 837       *                         income occurring at regular intervals.
 838       *                      Payments are negative value, income is positive values.
 839       * @param mixed $finance_rate The interest rate you pay on the money used in the cash flows
 840       * @param mixed $reinvestment_rate The interest rate you receive on the cash flows as you reinvest them
 841       *
 842       * @return float|string Result, or a string containing an error
 843       */
 844      public static function MIRR($values, $finance_rate, $reinvestment_rate)
 845      {
 846          return Financial\CashFlow\Variable\Periodic::modifiedRate($values, $finance_rate, $reinvestment_rate);
 847      }
 848  
 849      /**
 850       * NOMINAL.
 851       *
 852       * Returns the nominal interest rate given the effective rate and the number of compounding payments per year.
 853       *
 854       * Excel Function:
 855       *        NOMINAL(effect_rate, npery)
 856       *
 857       * @Deprecated 1.18.0
 858       *
 859       * @see Financial\InterestRate::nominal()
 860       *      Use the nominal() method in the Financial\InterestRate class instead
 861       *
 862       * @param float $effectiveRate Effective interest rate
 863       * @param int $periodsPerYear Number of compounding payments per year
 864       *
 865       * @return float|string Result, or a string containing an error
 866       */
 867      public static function NOMINAL($effectiveRate = 0, $periodsPerYear = 0)
 868      {
 869          return InterestRate::nominal($effectiveRate, $periodsPerYear);
 870      }
 871  
 872      /**
 873       * NPER.
 874       *
 875       * Returns the number of periods for a cash flow with constant periodic payments (annuities), and interest rate.
 876       *
 877       * @Deprecated 1.18.0
 878       *
 879       * @param float $rate Interest rate per period
 880       * @param int $pmt Periodic payment (annuity)
 881       * @param float $pv Present Value
 882       * @param float $fv Future Value
 883       * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
 884       *
 885       * @return float|string Result, or a string containing an error
 886       *
 887       *@see Financial\CashFlow\Constant\Periodic::periods()
 888       *      Use the periods() method in the Financial\CashFlow\Constant\Periodic class instead
 889       */
 890      public static function NPER($rate = 0, $pmt = 0, $pv = 0, $fv = 0, $type = 0)
 891      {
 892          return Financial\CashFlow\Constant\Periodic::periods($rate, $pmt, $pv, $fv, $type);
 893      }
 894  
 895      /**
 896       * NPV.
 897       *
 898       * Returns the Net Present Value of a cash flow series given a discount rate.
 899       *
 900       * @Deprecated 1.18.0
 901       *
 902       * @see Financial\CashFlow\Variable\Periodic::presentValue()
 903       *      Use the presentValue() method in the Financial\CashFlow\Variable\Periodic class instead
 904       *
 905       * @return float
 906       */
 907      public static function NPV(...$args)
 908      {
 909          return Financial\CashFlow\Variable\Periodic::presentValue(...$args);
 910      }
 911  
 912      /**
 913       * PDURATION.
 914       *
 915       * Calculates the number of periods required for an investment to reach a specified value.
 916       *
 917       * @Deprecated 1.18.0
 918       *
 919       * @see Financial\CashFlow\Single::periods()
 920       *      Use the periods() method in the Financial\CashFlow\Single class instead
 921       *
 922       * @param float $rate Interest rate per period
 923       * @param float $pv Present Value
 924       * @param float $fv Future Value
 925       *
 926       * @return float|string Result, or a string containing an error
 927       */
 928      public static function PDURATION($rate = 0, $pv = 0, $fv = 0)
 929      {
 930          return Financial\CashFlow\Single::periods($rate, $pv, $fv);
 931      }
 932  
 933      /**
 934       * PMT.
 935       *
 936       * Returns the constant payment (annuity) for a cash flow with a constant interest rate.
 937       *
 938       * @Deprecated 1.18.0
 939       *
 940       * @see Financial\CashFlow\Constant\Periodic\Payments::annuity()
 941       *      Use the annuity() method in the Financial\CashFlow\Constant\Periodic\Payments class instead
 942       *
 943       * @param float $rate Interest rate per period
 944       * @param int $nper Number of periods
 945       * @param float $pv Present Value
 946       * @param float $fv Future Value
 947       * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
 948       *
 949       * @return float|string Result, or a string containing an error
 950       */
 951      public static function PMT($rate = 0, $nper = 0, $pv = 0, $fv = 0, $type = 0)
 952      {
 953          return Financial\CashFlow\Constant\Periodic\Payments::annuity($rate, $nper, $pv, $fv, $type);
 954      }
 955  
 956      /**
 957       * PPMT.
 958       *
 959       * Returns the interest payment for a given period for an investment based on periodic, constant payments
 960       *         and a constant interest rate.
 961       *
 962       * @Deprecated 1.18.0
 963       *
 964       * @see Financial\CashFlow\Constant\Periodic\Payments::interestPayment()
 965       *      Use the interestPayment() method in the Financial\CashFlow\Constant\Periodic\Payments class instead
 966       *
 967       * @param float $rate Interest rate per period
 968       * @param int $per Period for which we want to find the interest
 969       * @param int $nper Number of periods
 970       * @param float $pv Present Value
 971       * @param float $fv Future Value
 972       * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
 973       *
 974       * @return float|string Result, or a string containing an error
 975       */
 976      public static function PPMT($rate, $per, $nper, $pv, $fv = 0, $type = 0)
 977      {
 978          return Financial\CashFlow\Constant\Periodic\Payments::interestPayment($rate, $per, $nper, $pv, $fv, $type);
 979      }
 980  
 981      /**
 982       * PRICE.
 983       *
 984       * Returns the price per $100 face value of a security that pays periodic interest.
 985       *
 986       * @Deprecated 1.18.0
 987       *
 988       * @see Financial\Securities\Price::price()
 989       *      Use the price() method in the Financial\Securities\Price class instead
 990       *
 991       * @param mixed $settlement The security's settlement date.
 992       *                              The security settlement date is the date after the issue date when the security
 993       *                              is traded to the buyer.
 994       * @param mixed $maturity The security's maturity date.
 995       *                                The maturity date is the date when the security expires.
 996       * @param float $rate the security's annual coupon rate
 997       * @param float $yield the security's annual yield
 998       * @param float $redemption The number of coupon payments per year.
 999       *                              For annual payments, frequency = 1;
1000       *                              for semiannual, frequency = 2;
1001       *                              for quarterly, frequency = 4.
1002       * @param int $frequency
1003       * @param int $basis The type of day count to use.
1004       *                       0 or omitted    US (NASD) 30/360
1005       *                       1                Actual/actual
1006       *                       2                Actual/360
1007       *                       3                Actual/365
1008       *                       4                European 30/360
1009       *
1010       * @return float|string Result, or a string containing an error
1011       */
1012      public static function PRICE($settlement, $maturity, $rate, $yield, $redemption, $frequency, $basis = 0)
1013      {
1014          return Securities\Price::price($settlement, $maturity, $rate, $yield, $redemption, $frequency, $basis);
1015      }
1016  
1017      /**
1018       * PRICEDISC.
1019       *
1020       * Returns the price per $100 face value of a discounted security.
1021       *
1022       * @Deprecated 1.18.0
1023       *
1024       * @see Financial\Securities\Price::priceDiscounted()
1025       *      Use the priceDiscounted() method in the Financial\Securities\Price class instead
1026       *
1027       * @param mixed $settlement The security's settlement date.
1028       *                              The security settlement date is the date after the issue date when the security
1029       *                              is traded to the buyer.
1030       * @param mixed $maturity The security's maturity date.
1031       *                            The maturity date is the date when the security expires.
1032       * @param int $discount The security's discount rate
1033       * @param int $redemption The security's redemption value per $100 face value
1034       * @param int $basis The type of day count to use.
1035       *                                        0 or omitted    US (NASD) 30/360
1036       *                                        1                Actual/actual
1037       *                                        2                Actual/360
1038       *                                        3                Actual/365
1039       *                                        4                European 30/360
1040       *
1041       * @return float|string Result, or a string containing an error
1042       */
1043      public static function PRICEDISC($settlement, $maturity, $discount, $redemption, $basis = 0)
1044      {
1045          return Securities\Price::priceDiscounted($settlement, $maturity, $discount, $redemption, $basis);
1046      }
1047  
1048      /**
1049       * PRICEMAT.
1050       *
1051       * Returns the price per $100 face value of a security that pays interest at maturity.
1052       *
1053       * @Deprecated 1.18.0
1054       *
1055       * @see Financial\Securities\Price::priceAtMaturity()
1056       *      Use the priceAtMaturity() method in the Financial\Securities\Price class instead
1057       *
1058       * @param mixed $settlement The security's settlement date.
1059       *                              The security's settlement date is the date after the issue date when the security
1060       *                              is traded to the buyer.
1061       * @param mixed $maturity The security's maturity date.
1062       *                            The maturity date is the date when the security expires.
1063       * @param mixed $issue The security's issue date
1064       * @param int $rate The security's interest rate at date of issue
1065       * @param int $yield The security's annual yield
1066       * @param int $basis The type of day count to use.
1067       *                                        0 or omitted    US (NASD) 30/360
1068       *                                        1                Actual/actual
1069       *                                        2                Actual/360
1070       *                                        3                Actual/365
1071       *                                        4                European 30/360
1072       *
1073       * @return float|string Result, or a string containing an error
1074       */
1075      public static function PRICEMAT($settlement, $maturity, $issue, $rate, $yield, $basis = 0)
1076      {
1077          return Securities\Price::priceAtMaturity($settlement, $maturity, $issue, $rate, $yield, $basis);
1078      }
1079  
1080      /**
1081       * PV.
1082       *
1083       * Returns the Present Value of a cash flow with constant payments and interest rate (annuities).
1084       *
1085       * @Deprecated 1.18.0
1086       *
1087       * @see Financial\CashFlow\Constant\Periodic::presentValue()
1088       *      Use the presentValue() method in the Financial\CashFlow\Constant\Periodic class instead
1089       *
1090       * @param float $rate Interest rate per period
1091       * @param int $nper Number of periods
1092       * @param float $pmt Periodic payment (annuity)
1093       * @param float $fv Future Value
1094       * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
1095       *
1096       * @return float|string Result, or a string containing an error
1097       */
1098      public static function PV($rate = 0, $nper = 0, $pmt = 0, $fv = 0, $type = 0)
1099      {
1100          return Financial\CashFlow\Constant\Periodic::presentValue($rate, $nper, $pmt, $fv, $type);
1101      }
1102  
1103      /**
1104       * RATE.
1105       *
1106       * Returns the interest rate per period of an annuity.
1107       * RATE is calculated by iteration and can have zero or more solutions.
1108       * If the successive results of RATE do not converge to within 0.0000001 after 20 iterations,
1109       * RATE returns the #NUM! error value.
1110       *
1111       * Excel Function:
1112       *        RATE(nper,pmt,pv[,fv[,type[,guess]]])
1113       *
1114       * @Deprecated 1.18.0
1115       *
1116       * @see Financial\CashFlow\Constant\Periodic\Interest::rate()
1117       *      Use the rate() method in the Financial\CashFlow\Constant\Periodic class instead
1118       *
1119       * @param mixed $nper The total number of payment periods in an annuity
1120       * @param mixed $pmt The payment made each period and cannot change over the life
1121       *                                    of the annuity.
1122       *                                Typically, pmt includes principal and interest but no other
1123       *                                    fees or taxes.
1124       * @param mixed $pv The present value - the total amount that a series of future
1125       *                                    payments is worth now
1126       * @param mixed $fv The future value, or a cash balance you want to attain after
1127       *                                    the last payment is made. If fv is omitted, it is assumed
1128       *                                    to be 0 (the future value of a loan, for example, is 0).
1129       * @param mixed $type A number 0 or 1 and indicates when payments are due:
1130       *                                        0 or omitted    At the end of the period.
1131       *                                        1                At the beginning of the period.
1132       * @param mixed $guess Your guess for what the rate will be.
1133       *                                    If you omit guess, it is assumed to be 10 percent.
1134       *
1135       * @return float|string
1136       */
1137      public static function RATE($nper, $pmt, $pv, $fv = 0.0, $type = 0, $guess = 0.1)
1138      {
1139          return Financial\CashFlow\Constant\Periodic\Interest::rate($nper, $pmt, $pv, $fv, $type, $guess);
1140      }
1141  
1142      /**
1143       * RECEIVED.
1144       *
1145       * Returns the amount received at maturity for a fully invested Security.
1146       *
1147       * @Deprecated 1.18.0
1148       *
1149       * @see Financial\Securities\Price::received()
1150       *      Use the received() method in the Financial\Securities\Price class instead
1151       *
1152       * @param mixed $settlement The security's settlement date.
1153       *                              The security settlement date is the date after the issue date when the security
1154       *                                  is traded to the buyer.
1155       * @param mixed $maturity The security's maturity date.
1156       *                            The maturity date is the date when the security expires.
1157       * @param mixed $investment The amount invested in the security
1158       * @param mixed $discount The security's discount rate
1159       * @param mixed $basis The type of day count to use.
1160       *                         0 or omitted    US (NASD) 30/360
1161       *                         1               Actual/actual
1162       *                         2               Actual/360
1163       *                         3               Actual/365
1164       *                         4               European 30/360
1165       *
1166       * @return float|string Result, or a string containing an error
1167       */
1168      public static function RECEIVED($settlement, $maturity, $investment, $discount, $basis = 0)
1169      {
1170          return Financial\Securities\Price::received($settlement, $maturity, $investment, $discount, $basis);
1171      }
1172  
1173      /**
1174       * RRI.
1175       *
1176       * Calculates the interest rate required for an investment to grow to a specified future value .
1177       *
1178       * @Deprecated 1.18.0
1179       *
1180       * @see Financial\CashFlow\Single::interestRate()
1181       *      Use the interestRate() method in the Financial\CashFlow\Single class instead
1182       *
1183       * @param float $nper The number of periods over which the investment is made
1184       * @param float $pv Present Value
1185       * @param float $fv Future Value
1186       *
1187       * @return float|string Result, or a string containing an error
1188       */
1189      public static function RRI($nper = 0, $pv = 0, $fv = 0)
1190      {
1191          return Financial\CashFlow\Single::interestRate($nper, $pv, $fv);
1192      }
1193  
1194      /**
1195       * SLN.
1196       *
1197       * Returns the straight-line depreciation of an asset for one period
1198       *
1199       * @Deprecated 1.18.0
1200       *
1201       * @see Financial\Depreciation::SLN()
1202       *      Use the SLN() method in the Financial\Depreciation class instead
1203       *
1204       * @param mixed $cost Initial cost of the asset
1205       * @param mixed $salvage Value at the end of the depreciation
1206       * @param mixed $life Number of periods over which the asset is depreciated
1207       *
1208       * @return float|string Result, or a string containing an error
1209       */
1210      public static function SLN($cost, $salvage, $life)
1211      {
1212          return Depreciation::SLN($cost, $salvage, $life);
1213      }
1214  
1215      /**
1216       * SYD.
1217       *
1218       * Returns the sum-of-years' digits depreciation of an asset for a specified period.
1219       *
1220       * @Deprecated 1.18.0
1221       *
1222       * @see Financial\Depreciation::SYD()
1223       *      Use the SYD() method in the Financial\Depreciation class instead
1224       *
1225       * @param mixed $cost Initial cost of the asset
1226       * @param mixed $salvage Value at the end of the depreciation
1227       * @param mixed $life Number of periods over which the asset is depreciated
1228       * @param mixed $period Period
1229       *
1230       * @return float|string Result, or a string containing an error
1231       */
1232      public static function SYD($cost, $salvage, $life, $period)
1233      {
1234          return Depreciation::SYD($cost, $salvage, $life, $period);
1235      }
1236  
1237      /**
1238       * TBILLEQ.
1239       *
1240       * Returns the bond-equivalent yield for a Treasury bill.
1241       *
1242       * @Deprecated 1.18.0
1243       *
1244       * @see Financial\TreasuryBill::bondEquivalentYield()
1245       *      Use the bondEquivalentYield() method in the Financial\TreasuryBill class instead
1246       *
1247       * @param mixed $settlement The Treasury bill's settlement date.
1248       *                          The Treasury bill's settlement date is the date after the issue date when the
1249       *                              Treasury bill is traded to the buyer.
1250       * @param mixed $maturity The Treasury bill's maturity date.
1251       *                                The maturity date is the date when the Treasury bill expires.
1252       * @param int $discount The Treasury bill's discount rate
1253       *
1254       * @return float|string Result, or a string containing an error
1255       */
1256      public static function TBILLEQ($settlement, $maturity, $discount)
1257      {
1258          return TreasuryBill::bondEquivalentYield($settlement, $maturity, $discount);
1259      }
1260  
1261      /**
1262       * TBILLPRICE.
1263       *
1264       * Returns the price per $100 face value for a Treasury bill.
1265       *
1266       * @Deprecated 1.18.0
1267       *
1268       * @see Financial\TreasuryBill::price()
1269       *      Use the price() method in the Financial\TreasuryBill class instead
1270       *
1271       * @param mixed $settlement The Treasury bill's settlement date.
1272       *                                The Treasury bill's settlement date is the date after the issue date
1273       *                                    when the Treasury bill is traded to the buyer.
1274       * @param mixed $maturity The Treasury bill's maturity date.
1275       *                                The maturity date is the date when the Treasury bill expires.
1276       * @param int $discount The Treasury bill's discount rate
1277       *
1278       * @return float|string Result, or a string containing an error
1279       */
1280      public static function TBILLPRICE($settlement, $maturity, $discount)
1281      {
1282          return TreasuryBill::price($settlement, $maturity, $discount);
1283      }
1284  
1285      /**
1286       * TBILLYIELD.
1287       *
1288       * Returns the yield for a Treasury bill.
1289       *
1290       * @Deprecated 1.18.0
1291       *
1292       * @see Financial\TreasuryBill::yield()
1293       *      Use the yield() method in the Financial\TreasuryBill class instead
1294       *
1295       * @param mixed $settlement The Treasury bill's settlement date.
1296       *                                The Treasury bill's settlement date is the date after the issue date
1297       *                                    when the Treasury bill is traded to the buyer.
1298       * @param mixed $maturity The Treasury bill's maturity date.
1299       *                                The maturity date is the date when the Treasury bill expires.
1300       * @param int $price The Treasury bill's price per $100 face value
1301       *
1302       * @return float|mixed|string
1303       */
1304      public static function TBILLYIELD($settlement, $maturity, $price)
1305      {
1306          return TreasuryBill::yield($settlement, $maturity, $price);
1307      }
1308  
1309      /**
1310       * XIRR.
1311       *
1312       * Returns the internal rate of return for a schedule of cash flows that is not necessarily periodic.
1313       *
1314       * Excel Function:
1315       *        =XIRR(values,dates,guess)
1316       *
1317       * @Deprecated 1.18.0
1318       *
1319       * @see Financial\CashFlow\Variable\NonPeriodic::rate()
1320       *      Use the rate() method in the Financial\CashFlow\Variable\NonPeriodic class instead
1321       *
1322       * @param float[] $values     A series of cash flow payments
1323       *                                The series of values must contain at least one positive value & one negative value
1324       * @param mixed[] $dates      A series of payment dates
1325       *                                The first payment date indicates the beginning of the schedule of payments
1326       *                                All other dates must be later than this date, but they may occur in any order
1327       * @param float $guess        An optional guess at the expected answer
1328       *
1329       * @return float|mixed|string
1330       */
1331      public static function XIRR($values, $dates, $guess = 0.1)
1332      {
1333          return Financial\CashFlow\Variable\NonPeriodic::rate($values, $dates, $guess);
1334      }
1335  
1336      /**
1337       * XNPV.
1338       *
1339       * Returns the net present value for a schedule of cash flows that is not necessarily periodic.
1340       * To calculate the net present value for a series of cash flows that is periodic, use the NPV function.
1341       *
1342       * Excel Function:
1343       *        =XNPV(rate,values,dates)
1344       *
1345       * @Deprecated 1.18.0
1346       *
1347       * @see Financial\CashFlow\Variable\NonPeriodic::presentValue()
1348       *      Use the presentValue() method in the Financial\CashFlow\Variable\NonPeriodic class instead
1349       *
1350       * @param float $rate the discount rate to apply to the cash flows
1351       * @param float[] $values A series of cash flows that corresponds to a schedule of payments in dates.
1352       *                          The first payment is optional and corresponds to a cost or payment that occurs
1353       *                              at the beginning of the investment.
1354       *                          If the first value is a cost or payment, it must be a negative value.
1355       *                             All succeeding payments are discounted based on a 365-day year.
1356       *                          The series of values must contain at least one positive value and one negative value.
1357       * @param mixed[] $dates A schedule of payment dates that corresponds to the cash flow payments.
1358       *                         The first payment date indicates the beginning of the schedule of payments.
1359       *                         All other dates must be later than this date, but they may occur in any order.
1360       *
1361       * @return float|mixed|string
1362       */
1363      public static function XNPV($rate, $values, $dates)
1364      {
1365          return Financial\CashFlow\Variable\NonPeriodic::presentValue($rate, $values, $dates);
1366      }
1367  
1368      /**
1369       * YIELDDISC.
1370       *
1371       * Returns the annual yield of a security that pays interest at maturity.
1372       *
1373       * @Deprecated 1.18.0
1374       *
1375       * @see Financial\Securities\Yields::yieldDiscounted()
1376       *      Use the yieldDiscounted() method in the Financial\Securities\Yields class instead
1377       *
1378       * @param mixed $settlement The security's settlement date.
1379       *                              The security's settlement date is the date after the issue date when the security
1380       *                              is traded to the buyer.
1381       * @param mixed $maturity The security's maturity date.
1382       *                            The maturity date is the date when the security expires.
1383       * @param int $price The security's price per $100 face value
1384       * @param int $redemption The security's redemption value per $100 face value
1385       * @param int $basis The type of day count to use.
1386       *                                        0 or omitted    US (NASD) 30/360
1387       *                                        1                Actual/actual
1388       *                                        2                Actual/360
1389       *                                        3                Actual/365
1390       *                                        4                European 30/360
1391       *
1392       * @return float|string Result, or a string containing an error
1393       */
1394      public static function YIELDDISC($settlement, $maturity, $price, $redemption, $basis = 0)
1395      {
1396          return Securities\Yields::yieldDiscounted($settlement, $maturity, $price, $redemption, $basis);
1397      }
1398  
1399      /**
1400       * YIELDMAT.
1401       *
1402       * Returns the annual yield of a security that pays interest at maturity.
1403       *
1404       * @Deprecated 1.18.0
1405       *
1406       * @see Financial\Securities\Yields::yieldAtMaturity()
1407       *      Use the yieldAtMaturity() method in the Financial\Securities\Yields class instead
1408       *
1409       * @param mixed $settlement The security's settlement date.
1410       *                              The security's settlement date is the date after the issue date when the security
1411       *                              is traded to the buyer.
1412       * @param mixed $maturity The security's maturity date.
1413       *                            The maturity date is the date when the security expires.
1414       * @param mixed $issue The security's issue date
1415       * @param int $rate The security's interest rate at date of issue
1416       * @param int $price The security's price per $100 face value
1417       * @param int $basis The type of day count to use.
1418       *                       0 or omitted    US (NASD) 30/360
1419       *                       1               Actual/actual
1420       *                       2               Actual/360
1421       *                       3               Actual/365
1422       *                       4               European 30/360
1423       *
1424       * @return float|string Result, or a string containing an error
1425       */
1426      public static function YIELDMAT($settlement, $maturity, $issue, $rate, $price, $basis = 0)
1427      {
1428          return Securities\Yields::yieldAtMaturity($settlement, $maturity, $issue, $rate, $price, $basis);
1429      }
1430  }