1 | <?php |
||
9 | class FormBuilder |
||
10 | { |
||
11 | |||
12 | /** |
||
13 | * @var Container |
||
14 | */ |
||
15 | protected $container; |
||
16 | |||
17 | /** |
||
18 | * @var FormHelper |
||
19 | */ |
||
20 | protected $formHelper; |
||
21 | |||
22 | /** |
||
23 | * @var EventDispatcher |
||
24 | */ |
||
25 | protected $eventDispatcher; |
||
26 | |||
27 | /** |
||
28 | * @param Container $container |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $plainFormClass = Form::class; |
||
32 | |||
33 | /** |
||
34 | * @param Container $container |
||
35 | * @param FormHelper $formHelper |
||
36 | * @param EventDispatcher $eventDispatcher |
||
37 | */ |
||
38 | 130 | public function __construct(Container $container, FormHelper $formHelper, EventDispatcher $eventDispatcher) |
|
44 | |||
45 | /** |
||
46 | * Fire an event. |
||
47 | * |
||
48 | * @param object $event |
||
49 | * @return array|null |
||
50 | */ |
||
51 | 9 | public function fireEvent($event) |
|
55 | |||
56 | /** |
||
57 | * Create a Form instance. |
||
58 | * |
||
59 | * @param string $formClass The name of the class that inherits \Kris\LaravelFormBuilder\Form. |
||
60 | * @param array $options|null |
||
|
|||
61 | * @param array $data|null |
||
62 | * @return Form |
||
63 | */ |
||
64 | 18 | public function create($formClass, array $options = [], array $data = []) |
|
84 | |||
85 | /** |
||
86 | * @param $items |
||
87 | * @param array $options |
||
88 | * @param array $data |
||
89 | * @return mixed |
||
90 | */ |
||
91 | 1 | public function createByArray($items, array $options = [], array $data = []) |
|
107 | |||
108 | /** |
||
109 | * @param $form |
||
110 | * @param $items |
||
111 | */ |
||
112 | 1 | public function buildFormByArray($form, $items) |
|
129 | |||
130 | /** |
||
131 | * Get the namespace from the config |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | 18 | protected function getNamespaceFromConfig() |
|
145 | |||
146 | /** |
||
147 | * Get instance of the empty form which can be modified |
||
148 | * Get the plain form class. |
||
149 | * |
||
150 | * @return string |
||
151 | */ |
||
152 | public function getFormClass() { |
||
155 | |||
156 | /** |
||
157 | * Set the plain form class. |
||
158 | * |
||
159 | * @param string $class |
||
160 | */ |
||
161 | public function setFormClass($class) { |
||
169 | |||
170 | /** |
||
171 | * Get instance of the empty form which can be modified. |
||
172 | * |
||
173 | * @param array $options |
||
174 | * @param array $data |
||
175 | * @return \Kris\LaravelFormBuilder\Form |
||
176 | */ |
||
177 | 130 | public function plain(array $options = [], array $data = []) |
|
191 | |||
192 | /** |
||
193 | * Set depedencies and options on existing form instance |
||
194 | * |
||
195 | * @param \Kris\LaravelFormBuilder\Form $instance |
||
196 | * @param array $options |
||
197 | * @param array $data |
||
198 | * @return \Kris\LaravelFormBuilder\Form |
||
199 | */ |
||
200 | 130 | public function setDependenciesAndOptions($instance, array $options = [], array $data = []) |
|
211 | } |
||
212 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.