AdminUserType::getBlockPrefix()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
nc 1
cc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of AppName.
5
 *
6
 * (c) Monofony
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
namespace App\Form\Type\User;
13
14
use App\Entity\User\AdminAvatar;
15
use App\Form\Type\Media\ImageEntityType;
16
use Sylius\Bundle\UserBundle\Form\Type\UserType;
17
use Symfony\Component\Form\Extension\Core\Type\TextType;
18
use Symfony\Component\Form\FormBuilderInterface;
19
20
class AdminUserType extends UserType
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function buildForm(FormBuilderInterface $builder, array $options): void
26
    {
27
        parent::buildForm($builder, $options);
28
29
        $builder
30
            ->add('firstName', TextType::class, [
31
                'label' => 'sylius.ui.first_name',
32
            ])
33
            ->add('lastName', TextType::class, [
34
                'label' => 'sylius.ui.last_name',
35
            ])
36
            ->add('avatar', AdminAvatarType::class, [
37
                'label' => 'app.ui.avatar',
38
                'required' => false,
39
            ]);
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function getBlockPrefix()
46
    {
47
        return 'sylius_admin_user';
48
    }
49
}
50