| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function beforeDateNode(DateNode $node) |
||
| 33 | { |
||
| 34 | try { |
||
| 35 | $node->setAttribute( |
||
| 36 | 'date', |
||
| 37 | new \DateTimeImmutable($node->getValue()) |
||
| 38 | ); |
||
| 39 | } catch (\Exception $e) { |
||
| 40 | $this->addError( |
||
| 41 | "Invalid date %s on line %s", |
||
| 42 | $node->getValue(), |
||
| 43 | (string)$node->getLineNr() |
||
| 44 | ); |
||
| 45 | } |
||
| 46 | } |
||
| 47 | } |
||
| 48 |