Conditions | 6 |
Paths | 1 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
47 | 4 | public static function create(array $data) |
|
48 | { |
||
49 | 4 | return new self( |
|
50 | 4 | isset($data['time']) ? new \DateTime($data['time']) : null, |
|
|
|||
51 | 4 | isset($data['accepted']) ? $data['accepted'] : [], |
|
52 | 4 | isset($data['delivered']) ? $data['delivered'] : [], |
|
53 | 4 | isset($data['failed']) ? $data['failed'] : [], |
|
54 | 4 | isset($data['complained']) ? $data['complained'] : [] |
|
55 | 4 | ); |
|
56 | } |
||
57 | |||
114 |
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: