| Total Complexity | 4 |
| Total Lines | 17 |
| Duplicated Lines | 0 % |
| Coverage | 66.67% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class DateBeforeValidation extends AbstractValidation implements ValidationInterface |
||
| 11 | { |
||
| 12 | |||
| 13 | 9 | public function isValid(ValueObject $data) |
|
| 14 | { |
||
| 15 | 9 | $valueTime = strtotime($data->value()); |
|
| 16 | 9 | $targetTime = strtotime($this->options[0]); |
|
| 17 | 9 | return $valueTime < $targetTime; |
|
| 18 | } |
||
| 19 | |||
| 20 | protected function getDateForCompare(){ |
||
| 21 | if(isset($this->options[0]) ) return $this->options[0]; |
||
| 22 | } |
||
| 23 | |||
| 24 | 4 | public function errorMessage() |
|
| 27 | } |
||
| 28 | } |