1 | <?php |
||
11 | final class FormProcessor implements EntityProcessorInterface |
||
12 | { |
||
13 | /** @var FormFactoryInterface */ |
||
14 | private $factory; |
||
15 | /** @var string|FormTypeInterface */ |
||
16 | private $form; |
||
17 | /** @var array */ |
||
18 | private $options = []; |
||
19 | |||
20 | /** |
||
21 | * FormProcessor constructor. |
||
22 | * |
||
23 | * @param string|FormTypeInterface $form Form instance or form class (factory required for class) |
||
24 | * @param array $options Form options |
||
25 | * @param FormFactoryInterface|null $factory Optional if form already provided |
||
26 | * |
||
27 | * @throws \LogicException |
||
28 | */ |
||
29 | 5 | public function __construct($form, array $options = [], FormFactoryInterface $factory = null) |
|
39 | |||
40 | /** {@inheritdoc} */ |
||
41 | 5 | public function updateEntity($entity, $data) |
|
59 | } |
||
60 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.