| Conditions | 5 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5.025 |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 18 | 27 | protected function formatDefault() |
|
| 19 | { |
||
| 20 | 27 | if (1 === preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/', $this->input)) { |
|
| 21 | return (false !== \DateTime::createFromFormat(DATE_ISO8601, $this->input)); |
||
| 22 | } |
||
| 23 | |||
| 24 | 27 | if ($this->formatDate('Y-m-d H:i:s')) { |
|
| 25 | 4 | return true; |
|
| 26 | } |
||
| 27 | |||
| 28 | 26 | if ($this->formatDate('Y-m-d')) { |
|
| 29 | 4 | return true; |
|
| 30 | } |
||
| 31 | |||
| 32 | 26 | if ($this->formatDate('H:i:s')) { |
|
| 33 | 4 | return true; |
|
| 34 | } |
||
| 35 | |||
| 36 | 22 | return false; |
|
| 37 | } |
||
| 38 | |||
| 54 |