| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Lines | 11 |
| Ratio | 100 % |
| Tests | 5 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 3 | View Code Duplication | public function default($value) |
| 30 | { |
||
| 31 | 3 | if (is_object($value) && is_a($value, \DateTime::class)) { |
|
| 32 | /** @var \DateTime $value */ |
||
| 33 | 1 | $this->default = $value->format('Y-m-d H:i:s'); |
|
| 34 | } else { |
||
| 35 | 2 | $this->default = date('Y-m-d H:i:s', strtotime($value)); |
|
| 36 | } |
||
| 37 | |||
| 38 | 3 | return $this; |
|
| 39 | } |
||
| 40 | |||
| 66 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@returnannotation as described here.