NewsitemType::getBlockPrefix()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace KI\PublicationBundle\Form;
4
5
use KI\CoreBundle\Selector\ImageSelector;
6
use KI\PublicationBundle\Entity\Newsitem;
7
use KI\UserBundle\Selector\ClubSelector;
8
use Symfony\Component\Form\AbstractType;
9
use Symfony\Component\Form\Extension\Core\Type\FileType;
10
use Symfony\Component\Form\FormBuilderInterface;
11
use Symfony\Component\OptionsResolver\OptionsResolver;
12
13 View Code Duplication
class NewsitemType extends AbstractType
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

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.

Loading history...
14
{
15
    public function buildForm(FormBuilderInterface $builder, array $options)
16
    {
17
        $builder
18
            ->add('name')
19
            ->add('text')
20
            ->add('sendMail')
21
            ->add('authorClub', ClubSelector::class)
22
            ->add('image', ImageSelector::class)
23
            ->add('uploadedFiles', FileType::class, [
24
                    'multiple' => true,
25
                    'data_class' => null,
26
                    'required' => false,
27
                ]
28
            )
29
        ;
30
    }
31
32
    public function configureOptions(OptionsResolver $resolver)
33
    {
34
        $resolver->setDefaults([
35
            'data_class' => Newsitem::class,
36
            'csrf_protection' => false,
37
        ]);
38
    }
39
40
    public function getBlockPrefix()
41
    {
42
        return '';
43
    }
44
}
45