GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ArticleUserCommentType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 17
c 1
b 0
f 1
dl 0
loc 37
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getBlockPrefix() 0 3 1
A buildForm() 0 20 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\BlogBundle\Form\Type;
6
7
use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
8
use Symfony\Component\Form\Extension\Core\Type\EmailType;
9
use Symfony\Component\Form\Extension\Core\Type\TextType;
10
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
11
use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaType;
12
use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrue as RecaptchaTrue;
13
use Symfony\Component\Form\FormBuilderInterface;
14
15
final class ArticleUserCommentType extends AbstractResourceType
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function buildForm(FormBuilderInterface $builder, array $options): void
21
    {
22
        $builder
23
            ->add('name', TextType::class, [
24
                'required' => true,
25
                'label' => 'odiseo_blog.form.name',
26
            ])
27
            ->add('email', EmailType::class, [
28
                'required' => true,
29
                'label' => 'odiseo_blog.form.email',
30
            ])
31
            ->add('comment', TextareaType::class, [
32
                'required' => true,
33
                'label' => 'odiseo_blog.form.comment',
34
            ])
35
            ->add('recaptcha', EWZRecaptchaType::class, [
36
                'mapped' => false,
37
                'constraints' => [
38
                    new RecaptchaTrue([
39
                        'groups' => ['odiseo_user_comment']
40
                    ])
41
                ]
42
            ])
43
        ;
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function getBlockPrefix(): string
50
    {
51
        return 'odiseo_blog_article_user_comment';
52
    }
53
}
54