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 | 124 | public function __construct(Container $container, FormHelper $formHelper, EventDispatcher $eventDispatcher) |
|
44 | |||
45 | /** |
||
46 | * Create a Form instance. |
||
47 | * |
||
48 | * @param string $formClass The name of the class that inherits \Kris\LaravelFormBuilder\Form. |
||
49 | * @param array $options|null |
||
|
|||
50 | * @param array $data|null |
||
51 | * @return Form |
||
52 | */ |
||
53 | 18 | public function create($formClass, array $options = [], array $data = []) |
|
73 | |||
74 | /** |
||
75 | * @param $items |
||
76 | * @param array $options |
||
77 | * @param array $data |
||
78 | * @return mixed |
||
79 | */ |
||
80 | 1 | public function createByArray($items, array $options = [], array $data = []) |
|
96 | |||
97 | /** |
||
98 | * @param $form |
||
99 | * @param $items |
||
100 | */ |
||
101 | 1 | public function buildFormByArray($form, $items) |
|
118 | |||
119 | /** |
||
120 | * Get the namespace from the config |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | 18 | protected function getNamespaceFromConfig() |
|
134 | |||
135 | /** |
||
136 | * Get instance of the empty form which can be modified |
||
137 | * Get the plain form class. |
||
138 | * |
||
139 | * @return string |
||
140 | */ |
||
141 | public function getFormClass() { |
||
144 | |||
145 | /** |
||
146 | * Set the plain form class. |
||
147 | * |
||
148 | * @param string $class |
||
149 | */ |
||
150 | public function setFormClass($class) { |
||
158 | |||
159 | /** |
||
160 | * Get instance of the empty form which can be modified. |
||
161 | * |
||
162 | * @param array $options |
||
163 | * @param array $data |
||
164 | * @return \Kris\LaravelFormBuilder\Form |
||
165 | */ |
||
166 | 124 | public function plain(array $options = [], array $data = []) |
|
180 | |||
181 | /** |
||
182 | * Set depedencies and options on existing form instance |
||
183 | * |
||
184 | * @param \Kris\LaravelFormBuilder\Form $instance |
||
185 | * @param array $options |
||
186 | * @param array $data |
||
187 | * @return \Kris\LaravelFormBuilder\Form |
||
188 | */ |
||
189 | 124 | public function setDependenciesAndOptions($instance, array $options = [], array $data = []) |
|
200 | } |
||
201 |
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.