@@ -17,8 +17,8 @@ |
||
17 | 17 | return $valueTime < $targetTime; |
18 | 18 | } |
19 | 19 | |
20 | - protected function getDateForCompare(){ |
|
21 | - if(isset($this->options[0]) ) return $this->options[0]; |
|
20 | + protected function getDateForCompare() { |
|
21 | + if (isset($this->options[0])) return $this->options[0]; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | public function errorMessage() |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | { |
12 | 12 | public function isValid(ValueObject $data) |
13 | 13 | { |
14 | - if( ! is_string($data->value()) ) return false; |
|
15 | - if(isset($this->options[0])){ |
|
14 | + if (!is_string($data->value())) return false; |
|
15 | + if (isset($this->options[0])) { |
|
16 | 16 | $dateObj = DateTime::createFromFormat($this->options[0], $data->value()); |
17 | 17 | return $dateObj && $dateObj->format($this->options[0]) === $data->value(); |
18 | 18 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | public function errorMessage() |
29 | 29 | { |
30 | - if(isset($this->options[0])) return "{$this->data->name()} is not in date format {$this->options[0]}"; |
|
30 | + if (isset($this->options[0])) return "{$this->data->name()} is not in date format {$this->options[0]}"; |
|
31 | 31 | |
32 | 32 | return "{$this->data->name()} must be a valid date"; |
33 | 33 | } |
@@ -16,8 +16,8 @@ |
||
16 | 16 | return $valueTime > $targetTime; |
17 | 17 | } |
18 | 18 | |
19 | - protected function getDateForCompare(){ |
|
20 | - if(isset($this->options[0]) ) return $this->options[0]; |
|
19 | + protected function getDateForCompare() { |
|
20 | + if (isset($this->options[0])) return $this->options[0]; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | protected function errorMessage() |
@@ -14,7 +14,7 @@ |
||
14 | 14 | $targetStartTime = strtotime($this->options[0]); |
15 | 15 | $targetEndTime = strtotime($this->options[1]); |
16 | 16 | |
17 | - return ( $valueTime > $targetStartTime ) && ( $valueTime < $targetEndTime); |
|
17 | + return ($valueTime > $targetStartTime) && ($valueTime < $targetEndTime); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | public function errorMessage() |