amarkal /
amarkal-ui
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Amarkal\UI; |
||
| 4 | |||
| 5 | /** |
||
| 6 | * Implements a Checkbox UI component. |
||
| 7 | */ |
||
| 8 | View Code Duplication | class Component_checkbox |
|
|
0 ignored issues
–
show
|
|||
| 9 | extends AbstractComponent |
||
|
0 ignored issues
–
show
|
|||
| 10 | implements ValueComponentInterface |
||
|
0 ignored issues
–
show
|
|||
| 11 | { |
||
| 12 | public function default_model() |
||
| 13 | { |
||
| 14 | return array( |
||
| 15 | 'name' => '', |
||
| 16 | 'disabled' => false, |
||
| 17 | 'required' => false, |
||
| 18 | 'readonly' => false, |
||
| 19 | 'data' => array() |
||
| 20 | ); |
||
| 21 | } |
||
| 22 | |||
| 23 | public function required_arguments() |
||
| 24 | { |
||
| 25 | return array('name'); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function get_template_path() |
||
| 29 | { |
||
| 30 | return __DIR__.'/template.phtml'; |
||
| 31 | } |
||
| 32 | } |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.