Completed
Push — 3.x ( 501e38...26e64c )
by Vincent
03:02
created

AbstractAdminExtension   A

Complexity

Total Complexity 24

Size/Duplication

Total Lines 113
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 24
lcom 0
cbo 0
dl 0
loc 113
rs 10
c 0
b 0
f 0

24 Methods

Rating   Name   Duplication   Size   Complexity  
A configureFormFields() 0 3 1
A configureListFields() 0 3 1
A configureDatagridFilters() 0 3 1
A configureShowFields() 0 3 1
A configureRoutes() 0 3 1
A configureSideMenu() 0 3 1
A configureTabMenu() 0 6 1
A validate() 0 3 1
A configureQuery() 0 3 1
A alterNewInstance() 0 3 1
A alterObject() 0 3 1
A getPersistentParameters() 0 4 1
A getAccessMapping() 0 4 1
A configureBatchActions() 0 4 1
A configureExportFields() 0 4 1
A preUpdate() 0 3 1
A postUpdate() 0 3 1
A prePersist() 0 3 1
A postPersist() 0 3 1
A preRemove() 0 3 1
A postRemove() 0 3 1
A configureDefaultFilterValues() 0 3 1
A configureActionButtons() 0 4 1
A configureDefaultSortValues() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\AdminBundle\Admin;
15
16
use Knp\Menu\ItemInterface as MenuItemInterface;
17
use Sonata\AdminBundle\Datagrid\DatagridMapper;
18
use Sonata\AdminBundle\Datagrid\ListMapper;
19
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
20
use Sonata\AdminBundle\Form\FormMapper;
21
use Sonata\AdminBundle\Route\RouteCollection;
22
use Sonata\AdminBundle\Show\ShowMapper;
23
use Sonata\Form\Validator\ErrorElement;
24
25
/**
26
 * @author Thomas Rabaix <[email protected]>
27
 */
28
abstract class AbstractAdminExtension implements AdminExtensionInterface
29
{
30
    public function configureFormFields(FormMapper $formMapper)
31
    {
32
    }
33
34
    public function configureListFields(ListMapper $listMapper)
35
    {
36
    }
37
38
    public function configureDatagridFilters(DatagridMapper $datagridMapper)
39
    {
40
    }
41
42
    public function configureShowFields(ShowMapper $showMapper)
43
    {
44
    }
45
46
    public function configureRoutes(AdminInterface $admin, RouteCollection $collection)
47
    {
48
    }
49
50
    public function configureSideMenu(AdminInterface $admin, MenuItemInterface $menu, $action, ?AdminInterface $childAdmin = null)
51
    {
52
    }
53
54
    public function configureTabMenu(AdminInterface $admin, MenuItemInterface $menu, $action, ?AdminInterface $childAdmin = null)
55
    {
56
        // Use configureSideMenu not to mess with previous overrides
57
        // NEXT_MAJOR: remove this line
58
        $this->configureSideMenu($admin, $menu, $action, $childAdmin);
59
    }
60
61
    public function validate(AdminInterface $admin, ErrorElement $errorElement, $object)
62
    {
63
    }
64
65
    public function configureQuery(AdminInterface $admin, ProxyQueryInterface $query, $context = 'list')
66
    {
67
    }
68
69
    public function alterNewInstance(AdminInterface $admin, $object)
70
    {
71
    }
72
73
    public function alterObject(AdminInterface $admin, $object)
74
    {
75
    }
76
77
    public function getPersistentParameters(AdminInterface $admin)
78
    {
79
        return [];
80
    }
81
82
    public function getAccessMapping(AdminInterface $admin)
0 ignored issues
show
Unused Code introduced by
The parameter $admin is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
83
    {
84
        return [];
85
    }
86
87
    public function configureBatchActions(AdminInterface $admin, array $actions)
0 ignored issues
show
Unused Code introduced by
The parameter $admin is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
88
    {
89
        return $actions;
90
    }
91
92
    public function configureExportFields(AdminInterface $admin, array $fields)
0 ignored issues
show
Unused Code introduced by
The parameter $admin is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
93
    {
94
        return $fields;
95
    }
96
97
    public function preUpdate(AdminInterface $admin, $object)
98
    {
99
    }
100
101
    public function postUpdate(AdminInterface $admin, $object)
102
    {
103
    }
104
105
    public function prePersist(AdminInterface $admin, $object)
106
    {
107
    }
108
109
    public function postPersist(AdminInterface $admin, $object)
110
    {
111
    }
112
113
    public function preRemove(AdminInterface $admin, $object)
114
    {
115
    }
116
117
    public function postRemove(AdminInterface $admin, $object)
118
    {
119
    }
120
121
    /**
122
     * @param array  $list
123
     * @param string $action
124
     * @param object $object
125
     *
126
     * @return array
127
     */
128
    public function configureActionButtons(AdminInterface $admin, $list, $action, $object)
0 ignored issues
show
Unused Code introduced by
The parameter $admin is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $action is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $object is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
129
    {
130
        return $list;
131
    }
132
133
    public function configureDefaultFilterValues(AdminInterface $admin, array &$filterValues)
0 ignored issues
show
Unused Code introduced by
The parameter $admin is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $filterValues is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
134
    {
135
    }
136
137
    public function configureDefaultSortValues(AdminInterface $admin, array &$sortValues): void
0 ignored issues
show
Unused Code introduced by
The parameter $admin is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $sortValues is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
138
    {
139
    }
140
}
141
142
class_exists(\Sonata\Form\Validator\ErrorElement::class);
143