| 1 | <?php |
||
| 17 | final class DynamicFormsChoicesMap implements DynamicFormsChoicesMapInterface |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * Maps data class to form name. |
||
| 21 | * |
||
| 22 | * @var string[] |
||
| 23 | */ |
||
| 24 | private $forms; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Maps form name to label. |
||
| 28 | * |
||
| 29 | * @var string[] |
||
| 30 | */ |
||
| 31 | private $labels; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * {@inheritdoc} |
||
| 35 | */ |
||
| 36 | public function addForm($group, $dataClass, $formName, $label) |
||
| 41 | |||
| 42 | /** |
||
| 43 | * {@inheritdoc} |
||
| 44 | */ |
||
| 45 | public function getFormsNamesByGroup($group) |
||
| 49 | |||
| 50 | /** |
||
| 51 | * {@inheritdoc} |
||
| 52 | */ |
||
| 53 | public function getFormNameByGroupAndDataClass($group, $dataClass) |
||
| 63 | |||
| 64 | /** |
||
| 65 | * {@inheritdoc} |
||
| 66 | */ |
||
| 67 | public function getDataClassByGroupAndFormName($group, $formName) |
||
| 77 | |||
| 78 | /** |
||
| 79 | * {@inheritdoc} |
||
| 80 | */ |
||
| 81 | public function getLabelByFormName($formName) |
||
| 85 | } |
||
| 86 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.