/** * @param DateTime|null $onDate optional, will default to 'now' * @return bool */ public function isEnabled(DateTime $onDate = null) { $onDate = $onDate ?: new DateTime(); return $this->dateRange->includes($onDate); }