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.

ArticleType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getBlockPrefix() 0 3 1
A buildForm() 0 29 1
1
<?php
2
3
namespace Odiseo\BlogBundle\Form\Type;
4
5
use Odiseo\BlogBundle\Model\ArticleCategory;
6
use Sylius\Bundle\ResourceBundle\Form\EventSubscriber\AddCodeFormSubscriber;
7
use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
8
use Sylius\Bundle\ResourceBundle\Form\Type\ResourceTranslationsType;
9
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
10
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
11
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
12
use Symfony\Component\Form\FormBuilderInterface;
13
14
/**
15
 * @author Diego D'amico <[email protected]>
16
 */
17
final class ArticleType extends AbstractResourceType
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function buildForm(FormBuilderInterface $builder, array $options)
23
    {
24
        $builder
25
            ->addEventSubscriber(new AddCodeFormSubscriber(null, [
26
                'label' => 'odiseo_blog.form.article.code',
27
            ]))
28
            ->add('enabled', CheckboxType::class, [
29
                'label' => 'odiseo_blog.form.article.enabled',
30
                'required' => true,
31
            ])
32
            ->add('translations', ResourceTranslationsType::class, [
33
                'entry_type' => ArticleTranslationType::class,
34
                'label'    => 'odiseo_blog.form.article.translations',
35
            ])
36
            ->add('categories', EntityType::class, [
37
                'class' => ArticleCategory::class,
38
                'multiple' => true,
39
                'expanded' => true,
40
                'label'    => 'odiseo_blog.form.article.categories',
41
                'required' => false,
42
            ])
43
            ->add('images', CollectionType::class, [
44
                'entry_type' => ArticleImageType::class,
45
                'allow_add' => true,
46
                'allow_delete' => true,
47
                'by_reference' => false,
48
                'label' => 'odiseo_blog.form.article.images',
49
                'block_name' => 'entry',
50
                'required' => false,
51
            ])
52
        ;
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public function getBlockPrefix()
59
    {
60
        return 'odiseo_blog_article';
61
    }
62
}
63