MessageAttachmentType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 13
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 6 1
A configureOptions() 0 2 1
1
<?php
2
3
namespace App\Form;
4
5
use App\Entity\MessageAttachment;
6
use Symfony\Component\Form\AbstractType;
7
use Symfony\Component\Form\FormBuilderInterface;
8
use Symfony\Component\OptionsResolver\OptionsResolver;
9
use Vich\UploaderBundle\Form\Type\VichFileType;
10
11
class MessageAttachmentType extends AbstractType {
12
    public function buildForm(FormBuilderInterface $builder, array $options) {
13
        $builder
14
            ->add('file', VichFileType::class, [
15
                'label' => 'label.file',
16
                'attr' => [
17
                    'in_collection' => true
18
                ]
19
            ]);
20
    }
21
22
    public function configureOptions(OptionsResolver $resolver) {
23
        $resolver->setDefault('data_class', MessageAttachment::class);
24
    }
25
}