1 | <?php |
||
15 | class Form implements |
||
16 | FormInterface, |
||
17 | WithModel, |
||
18 | Jsonable, |
||
19 | Arrayable, |
||
20 | JsonSerializable, |
||
21 | Validable |
||
22 | { |
||
23 | /** |
||
24 | * @var \Sco\Admin\Form\ElementsCollection |
||
25 | */ |
||
26 | protected $elements; |
||
27 | |||
28 | /** |
||
29 | * @var \Illuminate\Database\Eloquent\Model |
||
30 | */ |
||
31 | protected $model; |
||
32 | |||
33 | public function __construct(array $elements = []) |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | public function getElements() |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | public function setElements(array $elements) |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function addElement(ElementInterface $element) |
||
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function getModel() |
||
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | public function setModel(Model $model) |
||
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | public function setElementModel(Model $model) |
||
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | public function validate(array $data = []) |
||
115 | |||
116 | public function getValidationRules() |
||
120 | |||
121 | public function getValidationMessages() |
||
125 | |||
126 | public function getValidationTitles() |
||
130 | |||
131 | protected function getElementsValidationRules() |
||
141 | |||
142 | protected function getElementsValidationMessages() |
||
152 | |||
153 | protected function getElementsValidationTitles() |
||
163 | |||
164 | public function save() |
||
167 | |||
168 | /** |
||
169 | * {@inheritdoc} |
||
170 | */ |
||
171 | public function getValues() |
||
177 | |||
178 | public function toArray() |
||
185 | |||
186 | public function jsonSerialize() |
||
190 | |||
191 | public function toJson($options = 0) |
||
195 | |||
196 | public function __toString() |
||
200 | } |
||
201 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.