AdminAvatarType::configureOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of monofony.
5
 *
6
 * (c) Mobizel
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace App\Form\Type\User;
15
16
use App\Entity\User\AdminAvatar;
17
use Symfony\Component\Form\AbstractType;
18
use Symfony\Component\Form\Extension\Core\Type\FileType;
19
use Symfony\Component\Form\FormBuilderInterface;
20
use Symfony\Component\OptionsResolver\OptionsResolver;
21
22
final class AdminAvatarType extends AbstractType
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function buildForm(FormBuilderInterface $builder, array $options): void
28
    {
29
        parent::buildForm($builder, $options);
30
31
        $builder
32
            ->add('file', FileType::class, [
33
                'label' => false,
34
            ])
35
        ;
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function configureOptions(OptionsResolver $resolver): void
42
    {
43
        $resolver
44
            ->setDefaults([
45
                'data_class' => AdminAvatar::class,
46
            ])
47
        ;
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function getBlockPrefix(): string
54
    {
55
        return 'app_admin_avatar';
56
    }
57
}
58