Exemple #1
0
 /**
  * Returns the length of the month in days, taking account of the year.
  *
  * @return integer
  */
 public function getLengthOfMonth()
 {
     return Month::of($this->month)->getLength($this->isLeapYear());
 }
Exemple #2
0
 /**
  * Returns the day-of-year, from 1 to 365, or 366 in a leap year.
  *
  * @return integer
  */
 public function getDayOfYear()
 {
     return Month::of($this->month)->getFirstDayOfYear($this->isLeapYear()) + $this->day - 1;
 }
Exemple #3
0
 /**
  * @dataProvider providerToString
  *
  * @param string  $month        The month number.
  * @param integer $expectedName The expected month name.
  */
 public function testToString($month, $expectedName)
 {
     $this->assertSame($expectedName, (string) Month::of($month));
 }