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 | 110 | 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 = []) |
|
71 | |||
72 | /** |
||
73 | * @param $items |
||
74 | * @param array $options |
||
75 | * @param array $data |
||
76 | * @return mixed |
||
77 | */ |
||
78 | 1 | public function createByArray($items, array $options = [], array $data = []) |
|
92 | |||
93 | /** |
||
94 | * @param $form |
||
95 | * @param $items |
||
96 | */ |
||
97 | 1 | public function buildFormByArray($form, $items) |
|
114 | |||
115 | /** |
||
116 | * Get the namespace from the config |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | 18 | protected function getNamespaceFromConfig() |
|
130 | |||
131 | /** |
||
132 | * Get instance of the empty form which can be modified |
||
133 | * Get the plain form class. |
||
134 | * |
||
135 | * @return string |
||
136 | */ |
||
137 | public function getFormClass() { |
||
140 | |||
141 | /** |
||
142 | * Set the plain form class. |
||
143 | * |
||
144 | * @param string $class |
||
145 | */ |
||
146 | public function setFormClass($class) { |
||
154 | |||
155 | /** |
||
156 | * Get instance of the empty form which can be modified. |
||
157 | * |
||
158 | * @param array $options |
||
159 | * @param array $data |
||
160 | * @return \Kris\LaravelFormBuilder\Form |
||
161 | */ |
||
162 | 110 | public function plain(array $options = [], array $data = []) |
|
174 | |||
175 | /** |
||
176 | * Set depedencies and options on existing form instance |
||
177 | * |
||
178 | * @param \Kris\LaravelFormBuilder\Form $instance |
||
179 | * @param array $options |
||
180 | * @param array $data |
||
181 | * @return \Kris\LaravelFormBuilder\Form |
||
182 | */ |
||
183 | 110 | public function setDependenciesAndOptions($instance, array $options = [], array $data = []) |
|
194 | } |
||
195 |
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.