Conditions | 4 |
Paths | 4 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | public function parseContextual($value) |
||
38 | { |
||
39 | if (is_string($value) && $this->format) { |
||
40 | $value = DateUtil::tryParseDate($value, $this->format); |
||
41 | } |
||
42 | |||
43 | if (!$value instanceof DateTimeInterface) { |
||
44 | throw new SchemaAttributeParseException($this, "Provided value is not a valid date"); |
||
45 | } |
||
46 | |||
47 | return $value; |
||
48 | } |
||
67 | } |