| Conditions | 4 |
| Paths | 6 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 119 | public function __construct(array $data, UserSubscription $subscription = null) |
||
| 120 | { |
||
| 121 | // process data array |
||
| 122 | $this->startDate = new \DateTime(); |
||
| 123 | foreach ($data as $key => $value) { |
||
| 124 | if (property_exists($this, $key)) { |
||
| 125 | $this->$key = $value; |
||
| 126 | } |
||
| 127 | } |
||
| 128 | |||
| 129 | if (!$subscription) { |
||
| 130 | $this->subscription = new UserSubscription(); |
||
|
|
|||
| 131 | } else { |
||
| 132 | $this->subscription = $subscription; |
||
| 133 | } |
||
| 134 | |||
| 135 | return $this; |
||
| 136 | } |
||
| 137 | } |
||
| 138 |
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..