1 | <?php |
||
14 | class Hidden implements DataElementInterface, ValidatableElementInterface { |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $name; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $value; |
||
25 | |||
26 | /** |
||
27 | * @var HiddenValidatorInterface[] |
||
28 | */ |
||
29 | private $validators = []; |
||
30 | |||
31 | /** |
||
32 | * @var ValidationResult|null |
||
33 | */ |
||
34 | private $validationResult; |
||
35 | |||
36 | |||
37 | 10 | public function __construct(string $name, string $value = null) { |
|
41 | |||
42 | |||
43 | 6 | public function setValue(string $value) : self { |
|
48 | |||
49 | |||
50 | 6 | public function getValue() : string { |
|
53 | |||
54 | |||
55 | /** |
||
56 | * @param FormData $request |
||
57 | * @return $this |
||
58 | */ |
||
59 | 5 | public function handle(FormData $request) { |
|
64 | |||
65 | |||
66 | /** |
||
67 | * @return string |
||
68 | */ |
||
69 | 9 | public function getName() { |
|
72 | |||
73 | |||
74 | /** |
||
75 | * @return string |
||
76 | */ |
||
77 | 3 | public function render() { |
|
84 | |||
85 | |||
86 | 2 | public function addValidator(HiddenValidatorInterface $validator) : self { |
|
90 | |||
91 | |||
92 | 2 | public function validate() : ValidationResultInterface { |
|
106 | |||
107 | } |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.