public static function stringToTimeList($string) { $list = []; $times = split("([,; \n]+)", $string); for ($i = 0, $size = count($times); $i < $size; ++$i) { $time = mb_ereg_replace('[^0-9:]', ':', $times[$i]); try { $list[] = Time::create($time); } catch (WrongArgumentException $e) { /* ignore */ } } return $list; }
private function checkLimits(Time $time) { return !($this->min && $this->min->toSeconds() > $time->toSeconds()) && !($this->max && $this->max->toSeconds() < $time->toSeconds()); }