Conditions | 5 |
Paths | 16 |
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 | $sizeBytes = isset($data['size_bytes']) ? $data['size_bytes'] : null; |
||
45 | $mailbox = isset($data['mailbox']) ? $data['mailbox'] : null; |
||
46 | $login = isset($data['login']) ? $data['login'] : null; |
||
47 | $createdAt = isset($data['created_at']) ? new \DateTime($data['created_at']) : null; |
||
48 | |||
49 | return new self($sizeBytes, $createdAt, $mailbox, $login); |
||
|
|||
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: