| Conditions | 5 |
| Paths | 1 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public static function create(array $data) |
||
| 43 | { |
||
| 44 | return new self( |
||
| 45 | isset($data['time']) ? new \DateTime($data['time']) : null, |
||
|
|
|||
| 46 | isset($data['accepted']) ? $data['accepted'] : null, |
||
| 47 | isset($data['delivered']) ? $data['delivered'] : null, |
||
| 48 | isset($data['failed']) ? $data['failed'] : null |
||
| 49 | ); |
||
| 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: