Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
42 | 3 | public static function createFromArray(array $data): self |
|
43 | { |
||
44 | 3 | $model = new self(); |
|
45 | 3 | $model->coupon = Coupon::createFromArray($data['coupon']); |
|
|
|||
46 | 3 | $model->customer = $data['customer']; |
|
47 | 3 | $model->endAt = isset($data['end']) ? new \DateTimeImmutable('@'.$data['end']) : null; |
|
48 | 3 | $model->startAt = new \DateTimeImmutable('@'.$data['start']); |
|
49 | 3 | $model->subscription = $data['subscription']; |
|
50 | |||
51 | 3 | return $model; |
|
52 | } |
||
53 | |||
79 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..