Completed
Pull Request — master (#6097)
by Javier
05:41 queued 02:49
created

configureDefaultSortValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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): void
31
    {
32
    }
33
34
    public function configureListFields(ListMapper $listMapper): void
35
    {
36
    }
37
38
    public function configureDatagridFilters(DatagridMapper $datagridMapper): void
39
    {
40
    }
41
42
    public function configureShowFields(ShowMapper $showMapper): void
43
    {
44
    }
45
46
    public function configureRoutes(AdminInterface $admin, RouteCollection $collection): void
47
    {
48
    }
49
50
    public function configureSideMenu(AdminInterface $admin, MenuItemInterface $menu, $action, ?AdminInterface $childAdmin = null): void
51
    {
52
    }
53
54
    public function configureTabMenu(AdminInterface $admin, MenuItemInterface $menu, $action, ?AdminInterface $childAdmin = null): void
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): void
62
    {
63
    }
64
65
    public function configureQuery(AdminInterface $admin, ProxyQueryInterface $query, $context = 'list'): void
66
    {
67
    }
68
69
    public function alterNewInstance(AdminInterface $admin, $object): void
70
    {
71
    }
72
73
    public function alterObject(AdminInterface $admin, $object): void
74
    {
75
    }
76
77
    public function getPersistentParameters(AdminInterface $admin)
78
    {
79
        return [];
80
    }
81
82
    public function getAccessMapping(AdminInterface $admin): array
83
    {
84
        return [];
85
    }
86
87
    public function configureBatchActions(AdminInterface $admin, array $actions): array
88
    {
89
        return $actions;
90
    }
91
92
    public function configureExportFields(AdminInterface $admin, array $fields): array
93
    {
94
        return $fields;
95
    }
96
97
    public function preUpdate(AdminInterface $admin, $object): void
98
    {
99
    }
100
101
    public function postUpdate(AdminInterface $admin, $object): void
102
    {
103
    }
104
105
    public function prePersist(AdminInterface $admin, $object): void
106
    {
107
    }
108
109
    public function postPersist(AdminInterface $admin, $object): void
110
    {
111
    }
112
113
    public function preRemove(AdminInterface $admin, $object): void
114
    {
115
    }
116
117
    public function postRemove(AdminInterface $admin, $object): void
118
    {
119
    }
120
121
    /**
122
     * @param object $object
123
     */
124
    public function configureActionButtons(
125
        AdminInterface $admin,
126
        array $list,
127
        string $action,
128
        $object
129
    ): array {
130
        return $list;
131
    }
132
133
    /**
134
     * Returns a list of default filters.
135
     */
136
    public function configureDefaultFilterValues(AdminInterface $admin, array &$filterValues): void
137
    {
138
    }
139
140
    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...
141
    {
142
    }
143
}
144
145
class_exists(\Sonata\Form\Validator\ErrorElement::class);
146