| Conditions | 5 |
| Paths | 1 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | 3 | public static function create(array $data) |
|
| 43 | { |
||
| 44 | 3 | return new self( |
|
| 45 | 3 | isset($data['time']) ? new \DateTime($data['time']) : null, |
|
|
|
|||
| 46 | 3 | isset($data['accepted']) ? $data['accepted'] : [], |
|
| 47 | 3 | isset($data['delivered']) ? $data['delivered'] : [], |
|
| 48 | 3 | isset($data['failed']) ? $data['failed'] : [] |
|
| 49 | 3 | ); |
|
| 50 | } |
||
| 51 | |||
| 98 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: