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 Kunstmaan\FormBundle\Form; |
||
4 | |||
5 | use Symfony\Component\Form\AbstractType; |
||
6 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
||
7 | use Symfony\Component\Form\FormBuilderInterface; |
||
8 | use Symfony\Component\OptionsResolver\OptionsResolver; |
||
9 | |||
10 | /** |
||
11 | * This class represents the type for the SubmitButtonPagePart |
||
12 | */ |
||
13 | View Code Duplication | class SubmitButtonPagePartAdminType extends AbstractType |
|
0 ignored issues
–
show
|
|||
14 | { |
||
15 | /** |
||
16 | * @param FormBuilderInterface $builder |
||
17 | * @param array $options |
||
18 | */ |
||
19 | 1 | public function buildForm(FormBuilderInterface $builder, array $options) |
|
20 | { |
||
21 | $builder |
||
22 | 1 | ->add('label', TextType::class, array( |
|
23 | 1 | 'required' => true, |
|
24 | 'label' => 'kuma_form.form.submit_button_page_part.label.label', |
||
25 | )); |
||
26 | 1 | } |
|
27 | |||
28 | /** |
||
29 | * @return string |
||
30 | */ |
||
31 | 1 | public function getBlockPrefix() |
|
32 | { |
||
33 | 1 | return 'kunstmaan_formbundle_singlelinetextpageparttype'; |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * @param OptionsResolver $resolver |
||
38 | */ |
||
39 | 1 | public function configureOptions(OptionsResolver $resolver) |
|
40 | { |
||
41 | 1 | $resolver->setDefaults(array('data_class' => 'Kunstmaan\FormBundle\Entity\PageParts\SubmitButtonPagePart')); |
|
42 | 1 | } |
|
43 | } |
||
44 |
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.