| Conditions | 4 |
| Paths | 6 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function validate($value) { |
||
| 16 | parent::validate($value); |
||
| 17 | $value = (string) $value; |
||
| 18 | \DateTime::createFromFormat($this->ref, $value); |
||
| 19 | $errors = \DateTime::getLastErrors(); |
||
| 20 | foreach ($errors['warnings'] as $warning) { |
||
| 21 | $this->warnings[]=new ConstraintViolation($warning, $value, $this->member, get_class($this), 'warning'); |
||
| 22 | } |
||
| 23 | return $errors['error_count']<=0 && (!$this->strict || $errors['warning_count']<=0); |
||
| 24 | } |
||
| 25 | |||
| 48 |