before = $before; $this->inc = $inc; } /** * Passes if $date is before $before * * {@inheritdoc} */ public function test(\DateTimeInterface $date) { if ($this->inc) { return $date <= $this->before; } return $date < $this->before; } /** * @return \DateTimeInterface */ public function getBefore() { return $this->before; } /** * @return bool */ public function isInc() { return $this->inc; } }