/** * @return string */ public function humanize() { if ($this->from->getDays() == $this->to->getDays()) { return $this->from->getDays() . ' days'; } return $this->from->getDays() . ' - ' . $this->to->getDays() . ' days'; }
/** * @covers ::toDateTime * @dataProvider dataToDateTime */ public function testToDateTime($input, $start, $result) { $days = new Days($input); $this->assertEquals($result->format('d m Y'), $days->toDateTime($start)->format('d m Y')); }