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