| Total Complexity | 7 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 90.91% |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 12 | class DateTimeTransformer implements TransformerInterface |
||
| 13 | { |
||
| 14 | 3 | public function __construct( |
|
| 17 | |||
| 18 | 2 | public function input(mixed $data): string |
|
| 19 | { |
||
| 20 | 2 | if ($data instanceof DateTimeInterface) { |
|
| 21 | 1 | return $data->format($this->dateFormat); |
|
| 22 | } |
||
| 23 | |||
| 24 | 1 | return $data !== null ? $data : ''; |
|
| 25 | } |
||
| 26 | |||
| 27 | 2 | public function output(string $value): ?DateTimeInterface |
|
| 36 | } |
||
| 37 | } |
||
| 38 |