Skip to content

Commit

Permalink
– updated README with the new AnnuityCalculator's methods
Browse files Browse the repository at this point in the history
  • Loading branch information
uruba committed Sep 21, 2015
1 parent c1c1c97 commit 5de5d4a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ namespace `FinanCalc\Calculators`
* **getAnnuityPeriodLengthInMonths()** – gets the length of each compounding period in months
* **getAnnuityPeriodLengthInDays()** – gets the length of each compounding period in days
* **getAnnuityInterest()** – gets i
* **getAnnuityLengthInYears()** – gets the length of the annuity in years
* **getAnnuityLengthInMonths()** – gets the length of the annuity in months
* **getAnnuityLengthInDays()** – gets the length of the annuity in days
* **getAnnuityEndDate(DateTime $startDate)** – gets the ending date of the annuity as a DateTime object, based on the starting date passed as a parameter
* **getAnnuityPresentValue(AnnuityPaymentTypes $annuityType)** – gets the present value of the annuity
* *AnuityPaymentTypes $annuityType* = determines whether the payments are made either at the beginning or the end of each of the annuity's periods
[*optional for perpetuities*]
Expand Down
20 changes: 10 additions & 10 deletions src/Calculators/AnnuityCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,16 @@ public function getAnnuityLengthInDays() {
);
}

/**
* @param DateTime $startDate
* @return DateTime
*/
public function getAnnuityEndDate(DateTime $startDate) {
return TimeSpan
::asDurationWithStartDate($startDate, 0, 0, (int)$this->getAnnuityLengthInDays())
->getEndDate();
}

/**
* @param AnnuityPaymentTypes $annuityType
* @return null|string
Expand Down Expand Up @@ -256,16 +266,6 @@ public function getAnnuityFutureValueInArrears() {
);
}

/**
* @param DateTime $startDate
* @return DateTime
*/
public function getAnnuityEndDate(DateTime $startDate) {
return TimeSpan
::asDurationWithStartDate($startDate, 0, 0, (int)$this->getAnnuityLengthInDays())
->getEndDate();
}

/**
* @param AnnuityPaymentTypes $annuityPaymentType
* @param AnnuityValueTypes $annuityValueType
Expand Down

0 comments on commit 5de5d4a

Please sign in to comment.