These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
0 ignored issues
–
show
|
|||
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 | // TODO remove once deprecation period is over |
||
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) |
||
83 | { |
||
84 | return []; |
||
85 | } |
||
86 | |||
87 | public function configureBatchActions(AdminInterface $admin, array $actions) |
||
88 | { |
||
89 | return $actions; |
||
90 | } |
||
91 | |||
92 | public function configureExportFields(AdminInterface $admin, array $fields) |
||
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 | public function configureActionButtons(AdminInterface $admin, $list, $action, $object) |
||
122 | { |
||
123 | return $list; |
||
124 | } |
||
125 | |||
126 | /** |
||
127 | * Returns a list of default filters. |
||
128 | */ |
||
129 | public function configureDefaultFilterValues(AdminInterface $admin, array &$filterValues): void |
||
130 | { |
||
131 | } |
||
132 | } |
||
133 | |||
134 | class_exists(\Sonata\Form\Validator\ErrorElement::class); |
||
135 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.