1 | <?php |
||
22 | class ProductOption implements ProductOptionInterface |
||
23 | { |
||
24 | use TimestampableTrait; |
||
25 | use TranslatableTrait { |
||
26 | __construct as private initializeTranslationsCollection; |
||
27 | getTranslation as private doGetTranslation; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @var mixed |
||
32 | */ |
||
33 | protected $id; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $code; |
||
39 | |||
40 | /** |
||
41 | * @var int |
||
42 | */ |
||
43 | protected $position; |
||
44 | |||
45 | /** |
||
46 | * @var Collection|ProductOptionValueInterface[] |
||
47 | */ |
||
48 | protected $values; |
||
49 | |||
50 | public function __construct() |
||
57 | |||
58 | /** |
||
59 | * @return string |
||
60 | */ |
||
61 | public function __toString(): string |
||
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function getId() |
||
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | public function getCode(): ?string |
||
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | public function setCode(?string $code): void |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | public function getName(): ?string |
||
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | public function setName(?string $name): void |
||
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | public function getPosition(): ?int |
||
113 | |||
114 | /** |
||
115 | * {@inheritdoc} |
||
116 | */ |
||
117 | public function setPosition(?int $position): void |
||
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | public function getValues(): Collection |
||
129 | |||
130 | /** |
||
131 | * {@inheritdoc} |
||
132 | */ |
||
133 | public function addValue(ProductOptionValueInterface $value): void |
||
140 | |||
141 | /** |
||
142 | * {@inheritdoc} |
||
143 | */ |
||
144 | public function removeValue(ProductOptionValueInterface $value): void |
||
151 | |||
152 | /** |
||
153 | * {@inheritdoc} |
||
154 | */ |
||
155 | public function hasValue(ProductOptionValueInterface $value): bool |
||
159 | |||
160 | /** |
||
161 | * @param string|null $locale |
||
162 | * |
||
163 | * @return ProductOptionTranslationInterface |
||
164 | */ |
||
165 | public function getTranslation(?string $locale = null): TranslationInterface |
||
172 | |||
173 | /** |
||
174 | * {@inheritdoc} |
||
175 | */ |
||
176 | protected function createTranslation(): ProductOptionTranslationInterface |
||
180 | } |
||
181 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: