1 | <?php |
||
15 | class Form extends AbstractElement |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private static $fieldsXPath = <<<FIELDS |
||
21 | //*[not(@disabled) and ( |
||
22 | (self::input and @type = 'radio' and @checked) |
||
23 | or (self::input and @type = 'checkbox' and @checked) |
||
24 | or (self::input and @type != 'radio' and @type != 'file' and @type != 'checkbox' and @type != 'submit') |
||
25 | or (self::input and not(@type)) |
||
26 | or self::select |
||
27 | or self::textarea |
||
28 | )] |
||
29 | FIELDS; |
||
30 | |||
31 | private static $filesXPath = "//input[not(@disabled) and @type = 'file' and @value]"; |
||
32 | private static $allFilesXPath = "//input[not(@disabled) and @type = 'file']"; |
||
33 | |||
34 | 3 | public static function toNestedParams(array $params) |
|
46 | |||
47 | /** |
||
48 | * @return string |
||
49 | */ |
||
50 | 1 | public static function getFieldsXPath() |
|
54 | |||
55 | /** |
||
56 | * @return string |
||
57 | */ |
||
58 | 1 | public static function getFilesXPath() |
|
62 | |||
63 | private $multipartBoundary = null; |
||
64 | |||
65 | /** |
||
66 | * @param string $multipartBoundary |
||
67 | */ |
||
68 | 1 | public function setMultipartBoundary($multipartBoundary) |
|
72 | |||
73 | /** |
||
74 | * @return string |
||
75 | */ |
||
76 | 1 | public function getMultipartBoundary() |
|
84 | |||
85 | /** |
||
86 | * @param string $xpath |
||
87 | * @return AbstractInput[] |
||
88 | */ |
||
89 | 1 | public function getInputs($xpath) |
|
96 | |||
97 | /** |
||
98 | * @return string |
||
99 | */ |
||
100 | 1 | public function getMethod() |
|
104 | |||
105 | /** |
||
106 | * @return boolean |
||
107 | */ |
||
108 | 1 | public function isGet() |
|
112 | |||
113 | /** |
||
114 | * @return string |
||
115 | */ |
||
116 | 1 | public function getAction() |
|
120 | |||
121 | /** |
||
122 | * @return boolean |
||
123 | */ |
||
124 | 1 | public function isMultipart() |
|
128 | |||
129 | /** |
||
130 | * @param array $additional |
||
131 | * @return array |
||
132 | */ |
||
133 | 1 | public function getData(array $additional = []) |
|
143 | |||
144 | /** |
||
145 | * @param array $additional |
||
146 | * @return array |
||
147 | */ |
||
148 | 1 | public function getMultipartData(array $additional = []) |
|
169 | |||
170 | /** |
||
171 | * @return array |
||
172 | */ |
||
173 | 3 | public function getHeaders() |
|
183 | |||
184 | /** |
||
185 | * @return array |
||
186 | */ |
||
187 | 1 | public function getFiles() |
|
199 | |||
200 | /** |
||
201 | * @param array $data |
||
202 | * @return ServerRequest |
||
203 | */ |
||
204 | 3 | public function getRequest(array $data = []) |
|
229 | } |
||
230 |
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.