Exemplo n.º 1
0
 /**
  * Swap the word representation with numeric's.
  *
  * @return $this
  */
 protected function swap()
 {
     $this->date[0] = self::dayLookup[$this->date[0]];
     $this->date[1] = self::monthLookup[$this->date[1]];
     $year = $this->numerology->sum($this->date[2], true);
     $this->date[2] = $year < 5000 ? 5000 + $year : $year;
     return $this->date;
 }
Exemplo n.º 2
0
 /**
  * Handle the parse request.
  *
  * @return array
  */
 public function format()
 {
     $day = self::dayLookup[$this->date[1]];
     $month = self::monthLookup[$this->date[0]];
     if (is_array($month)) {
         $month = isJewishLeapYear($this->date[2]) ? $month[1] : $month[0];
     }
     $year = $this->numerology->toHebrewYear($this->date[2]);
     return [$day, $month, $year];
 }
Exemplo n.º 3
0
 /**
  * @test
  * @expectedException InvalidArgumentException
  */
 public function it_should_throw_an_exception_if_the_input_isnt_a_number()
 {
     $this->numerology->toHebrewYear('התשעו');
 }