RepertoireSeasonAdmin   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 5
dl 0
loc 48
ccs 0
cts 25
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A configureDatagridFilters() 0 9 1
A configureListFields() 0 15 1
A configureFormFields() 0 8 1
A configureShowFields() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Admin;
6
7
use Sonata\AdminBundle\Admin\AbstractAdmin;
8
use Sonata\AdminBundle\Datagrid\DatagridMapper;
9
use Sonata\AdminBundle\Datagrid\ListMapper;
10
use Sonata\AdminBundle\Form\FormMapper;
11
use Sonata\AdminBundle\Show\ShowMapper;
12
use Sonata\Form\Type\DateTimePickerType;
13
14
final class RepertoireSeasonAdmin extends AbstractAdmin
15
{
16
17
    protected function configureDatagridFilters(DatagridMapper $datagridMapper): void
18
    {
19
        $datagridMapper
20
            ->add('id')
21
            ->add('startDate')
22
            ->add('endDate')
23
            ->add('number')
24
            ;
25
    }
26
27
    protected function configureListFields(ListMapper $listMapper): void
28
    {
29
        $listMapper
30
            ->add('id')
31
            ->add('startDate')
32
            ->add('endDate')
33
            ->add('number')
34
            ->add('_action', null, [
35
                'actions' => [
36
                    'show' => [],
37
                    'edit' => [],
38
                    'delete' => [],
39
                ],
40
            ]);
41
    }
42
43
    protected function configureFormFields(FormMapper $formMapper): void
44
    {
45
        $formMapper
46
            ->add('startDate', DateTimePickerType::class)
47
            ->add('endDate', DateTimePickerType::class)
48
            ->add('number')
49
            ;
50
    }
51
52
    protected function configureShowFields(ShowMapper $showMapper): void
53
    {
54
        $showMapper
55
            ->add('id')
56
            ->add('startDate')
57
            ->add('endDate')
58
            ->add('number')
59
            ;
60
    }
61
}
62