1: <?php
2:
3: namespace Cron;
4:
5: /**
6: * Minutes field. Allows: * , / -
7: */
8: class MinutesField extends AbstractField
9: {
10: public function isSatisfiedBy(\DateTime $date, $value)
11: {
12: return $this->isSatisfied($date->format('i'), $value);
13: }
14:
15: public function increment(\DateTime $date, $invert = false)
16: {
17: if ($invert) {
18: $date->modify('-1 minute');
19: } else {
20: $date->modify('+1 minute');
21: }
22:
23: return $this;
24: }
25:
26: public function validate($value)
27: {
28: return (bool) preg_match('/[\*,\/\-0-9]+/', $value);
29: }
30: }
31: