getDateForAge() public static method

If given a date of death, and they will never reach the age, returns null.
public static getDateForAge ( $dob, $age, null $date_of_death = null ) : null | string
$dob
$age
$date_of_death null
return null | string
コード例 #1
0
ファイル: Patient.php プロジェクト: openeyeswales/OpenEyes
 /**
  * Returns the date on which the patient will become an adult
  *
  * @return null|string
  */
 public function getBecomesAdultDate()
 {
     return Helper::getDateForAge($this->dob, isset(Yii::app()->params['child_age_limit']) ? Yii::app()->params['child_age_limit'] : self::CHILD_AGE_LIMIT);
 }
コード例 #2
0
 /**
  * @dataProvider getDateForAgeProvider
  */
 public function testgetDateForAge($expected, $dob, $age, $date_of_death = null)
 {
     $this->assertEquals($expected, Helper::getDateForAge($dob, $age, $date_of_death));
 }