| Total Complexity | 4 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | class UserSetting implements UserSettingInterface |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @Id |
||
| 25 | * @Column(type="integer") |
||
| 26 | * |
||
| 27 | */ |
||
| 28 | private int $user_id; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @Id |
||
| 32 | * @Column(type="string", enumType=UserSettingEnum::class) |
||
| 33 | * |
||
| 34 | */ |
||
| 35 | private UserSettingEnum $setting; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @Column(type="string") |
||
| 39 | * |
||
| 40 | */ |
||
| 41 | private string $value = ''; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * |
||
| 45 | * @ManyToOne(targetEntity="User") |
||
| 46 | * @JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE") |
||
| 47 | */ |
||
| 48 | private UserInterface $user; |
||
| 49 | |||
| 50 | public function setUser(UserInterface $user): UserSettingInterface |
||
| 51 | { |
||
| 52 | $this->user = $user; |
||
| 53 | $this->user_id = $user->getId(); |
||
| 54 | |||
| 55 | return $this; |
||
| 56 | } |
||
| 57 | |||
| 58 | public function setSetting(UserSettingEnum $setting): UserSettingInterface |
||
| 59 | { |
||
| 60 | $this->setting = $setting; |
||
|
|
|||
| 61 | |||
| 62 | return $this; |
||
| 63 | } |
||
| 64 | |||
| 65 | public function getValue(): string |
||
| 66 | { |
||
| 67 | return $this->value; |
||
| 68 | } |
||
| 69 | |||
| 70 | public function setValue(string $value): UserSettingInterface |
||
| 75 | } |
||
| 76 | } |
||
| 77 |
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..