| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Lines | 11 |
| Ratio | 100 % |
| Tests | 5 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 3 | View Code Duplication | public function default($value) |
| 21 | { |
||
| 22 | 3 | if (is_object($value) && is_a($value, \DateTime::class)) { |
|
| 23 | /** @var \DateTime $value */ |
||
| 24 | 1 | $this->default = $value->format('Y-m-d'); |
|
| 25 | } else { |
||
| 26 | 2 | $this->default = date('Y-m-d', strtotime($value)); |
|
| 27 | } |
||
| 28 | |||
| 29 | 3 | return $this; |
|
| 30 | } |
||
| 31 | |||
| 81 |
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.