| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Lines | 11 |
| Ratio | 100 % |
| Tests | 5 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | 3 | View Code Duplication | public function default($value) |
| 45 | { |
||
| 46 | 3 | if (is_object($value) && is_a($value, \DateTime::class)) { |
|
| 47 | /** @var \DateTime $value */ |
||
| 48 | 1 | $this->default = $value->format('H:i:s'); |
|
| 49 | } else { |
||
| 50 | 2 | $this->default = date('H:i:s', strtotime($value)); |
|
| 51 | } |
||
| 52 | |||
| 53 | 3 | return $this; |
|
| 54 | } |
||
| 55 | |||
| 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.