1 | <?php |
||
7 | class OptionsResolver extends BaseOptionsResolver |
||
8 | { |
||
9 | private $isLatestVersion; |
||
10 | |||
11 | /** |
||
12 | * Set a list of allowed types for the given option. |
||
13 | * |
||
14 | * @see Symfony\Component\OptionsResolver\OptionsResolver::setAllowedTypes() |
||
15 | * |
||
16 | * @param array $allowedTypes |
||
17 | * |
||
18 | * @return $this |
||
19 | */ |
||
20 | 31 | public function setTypesAllowed($allowedTypes = null) |
|
21 | { |
||
22 | 31 | if (!$this->isLatest()) { |
|
23 | return $this->setAllowedTypes($allowedTypes); |
||
24 | } |
||
25 | |||
26 | 31 | foreach ($allowedTypes as $option => $typesAllowed) { |
|
27 | 31 | $this->setAllowedTypes($option, $typesAllowed); |
|
28 | } |
||
29 | |||
30 | 31 | return $this; |
|
31 | } |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | 76 | public function setDefined($optionNames) |
|
44 | |||
45 | 22 | public function setNormalizers(array $normalizers) |
|
57 | |||
58 | /** |
||
59 | * Checks whether or not the OptionsResolver version is up-to-date. |
||
60 | * |
||
61 | * @return bool |
||
62 | */ |
||
63 | 77 | private function isLatest() |
|
71 | } |
||
72 |
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: