/** * 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; }
/** * 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]; }
/** * @test * @expectedException InvalidArgumentException */ public function it_should_throw_an_exception_if_the_input_isnt_a_number() { $this->numerology->toHebrewYear('התשעו'); }