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