Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
47 | 7 | public static function createFromArray(array $data): self |
|
48 | { |
||
49 | 7 | $model = new self(); |
|
50 | 7 | $model->id = $data['id']; |
|
51 | 7 | $model->createdAt = new \DateTimeImmutable('@'.$data['created']); |
|
52 | 7 | $model->metadata = MetadataCollection::createFromArray($data['metadata']); |
|
|
|||
53 | 7 | $model->plan = Plan::createFromArray($data['plan']); |
|
54 | 7 | $model->quantity = (int) $data['quantity']; |
|
55 | 7 | $model->subscription = $data['subscription']; |
|
56 | |||
57 | 7 | return $model; |
|
58 | } |
||
59 | |||
85 |
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..