Completed
Push — refonte ( 548acb...beeabd )
by Arnaud
10:11
created
src/Configuration/ActionConfiguration.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@
 block discarded – undo
15 15
 
16 16
 class ActionConfiguration extends Configuration
17 17
 {
18
-     /**
19
-     * Related Action name.
20
-     *
21
-     * @var string
22
-     */
18
+        /**
19
+         * Related Action name.
20
+         *
21
+         * @var string
22
+         */
23 23
     private $actionName;
24 24
 
25 25
     /**
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      */
159 159
     private function getFieldsNormalizer()
160 160
     {
161
-        return function (Options $options, $fields) {
161
+        return function(Options $options, $fields) {
162 162
             $normalizedFields = [];
163 163
 
164 164
             foreach ($fields as $name => $field) {
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
      */
182 182
     private function getOrderNormalizer()
183 183
     {
184
-        return function (Options $options, $order) {
184
+        return function(Options $options, $order) {
185 185
             foreach ($order as $field => $sort) {
186 186
 
187 187
                 if (!is_string($sort) || !is_string($field) || !in_array(strtolower($sort), ['asc', 'desc'])) {
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
      */
206 206
     private function getLoadStrategyNormalizer()
207 207
     {
208
-        return function (Options $options, $value) {
208
+        return function(Options $options, $value) {
209 209
             if (!$value) {
210 210
                 if ($this->actionName == 'create') {
211 211
                     $value = LAGAdminBundle::LOAD_STRATEGY_NONE;
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
      */
229 229
     private function getMenuNormalizer()
230 230
     {
231
-        return function (Options $options, $menus) {
231
+        return function(Options $options, $menus) {
232 232
             // set default to an array
233 233
             if ($menus === false) {
234 234
                 $menus = [];
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
      */
247 247
     private function getCriteriaNormalizer()
248 248
     {
249
-        return function (Options $options, $value) {
249
+        return function(Options $options, $value) {
250 250
             if (!$value) {
251 251
                 $idActions = [
252 252
                     'edit',
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
      */
296 296
     private function getFiltersNormalizer(): Closure
297 297
     {
298
-        return function (Options $options, $data) {
298
+        return function(Options $options, $data) {
299 299
             $normalizedData = [];
300 300
 
301 301
             foreach ($data as $name => $field) {
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 
323 323
     private function getRouteDefaultNormalizer(): Closure
324 324
     {
325
-        return function (Options $options, $value) {
325
+        return function(Options $options, $value) {
326 326
 
327 327
             if (!is_array($value)) {
328 328
                 $value = [];
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 
337 337
     private function getFormNormalizer(): Closure
338 338
     {
339
-        return function (Options $options, $value) {
339
+        return function(Options $options, $value) {
340 340
 
341 341
             if (null === $value) {
342 342
                 $mapping = [
Please login to merge, or discard this patch.
src/Bridge/Doctrine/ORM/DataProvider/ORMDataProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
         if ('pagerfanta' === $actionConfiguration->getParameter('pager')) {
83 83
             $pageParameter = $actionConfiguration->getParameter('page_parameter');
84 84
             $request = $this->requestStack->getCurrentRequest();
85
-            $page = (int)$request->get($pageParameter, 1);
85
+            $page = (int) $request->get($pageParameter, 1);
86 86
 
87 87
             $adapter = new DoctrineORMAdapter($queryBuilder);
88 88
             $pager = new Pagerfanta($adapter);
Please login to merge, or discard this patch.
src/Configuration/MenuItemConfiguration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@
 block discarded – undo
119 119
 
120 120
                 return $resolvedItems;
121 121
             })
122
-            ->setNormalizer('text', function (Options $options, $text) {
122
+            ->setNormalizer('text', function(Options $options, $text) {
123 123
                 if (!$text) {
124 124
                     // TODO use translation pattern key instead
125 125
                     $text = ucfirst($this->name);
Please login to merge, or discard this patch.
src/Configuration/MenuConfiguration.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
                 'vertical',
54 54
                 null
55 55
             ])
56
-            ->setNormalizer('position', function (Options $options, $value) {
56
+            ->setNormalizer('position', function(Options $options, $value) {
57 57
                 if ('top' === $this->menuName && null === $value) {
58 58
                     $value = 'horizontal';
59 59
                 }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
                 return $value;
66 66
             })
67
-            ->setNormalizer('template', function (Options $options, $value) {
67
+            ->setNormalizer('template', function(Options $options, $value) {
68 68
                 // Define bootstrap navbar component template
69 69
                 if ('horizontal' === $options->offsetGet('position')) {
70 70
                     $value = '@LAGAdmin/Menu/menu.horizontal.html.twig';
@@ -73,12 +73,12 @@  discard block
 block discarded – undo
73 73
 
74 74
                 // Define bootstrap nav component template
75 75
                 if ('vertical' === $options->offsetGet('position')) {
76
-                    $value ='@LAGAdmin/Menu/menu.vertical.html.twig';
76
+                    $value = '@LAGAdmin/Menu/menu.vertical.html.twig';
77 77
                 }
78 78
 
79 79
                 return $value;
80 80
             })
81
-            ->setNormalizer('attr', function (Options $options, $value) {
81
+            ->setNormalizer('attr', function(Options $options, $value) {
82 82
                 $position = $options->offsetGet('position');
83 83
 
84 84
                 if (!key_exists('class', $value)) {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
                 return $value;
98 98
             })
99
-            ->setNormalizer('item_css_class', function (Options $options, $value) {
99
+            ->setNormalizer('item_css_class', function(Options $options, $value) {
100 100
                 $position = $options->offsetGet('position');
101 101
 
102 102
                 if (!$value) {
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
                 return trim($value);
115 115
             })
116
-            ->setNormalizer('brand', function (Options $options, $value) {
116
+            ->setNormalizer('brand', function(Options $options, $value) {
117 117
                 if (null === $value && 'horizontal' === $options->offsetGet('position')) {
118 118
                     $value = $this->applicationName;
119 119
                 }
Please login to merge, or discard this patch.
src/Routing/RoutingLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
132 132
             }
133 133
 
134 134
             if ($this->applicationConfiguration->getParameter('enable_homepage')) {
135
-                $route = new Route('/', ['_controller' => HomeAction::class,], []);
135
+                $route = new Route('/', ['_controller' => HomeAction::class, ], []);
136 136
                 $routes->add('lag.admin.homepage', $route);
137 137
             }
138 138
         }
Please login to merge, or discard this patch.
src/Field/MappedField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,6 +36,6 @@
 block discarded – undo
36 36
             $value = $this->translator->trans($value);
37 37
         }
38 38
 
39
-        return (string)$value;
39
+        return (string) $value;
40 40
     }
41 41
 }
Please login to merge, or discard this patch.
src/Field/ActionCollectionField.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
                 'template' => '@LAGAdmin/Field/actionCollection.html.twig',
40 40
                 'actions' => [],
41 41
             ])
42
-            ->setNormalizer('actions', function (Options $options, $value) use ($actionConfiguration, $defaultActions) {
42
+            ->setNormalizer('actions', function(Options $options, $value) use ($actionConfiguration, $defaultActions) {
43 43
                 if (!is_array($value) || 0 === count($value)) {
44 44
                     $value = [
45 45
                         'edit' => [],
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                 '_self',
139 139
                 '_blank',
140 140
             ])
141
-            ->setNormalizer('route', function (Options $options, $value) use ($actionConfiguration) {
141
+            ->setNormalizer('route', function(Options $options, $value) use ($actionConfiguration) {
142 142
                 // route or url should be defined
143 143
                 if (!$value && !$options->offsetGet('url') && !$options->offsetGet('admin')) {
144 144
                     throw new InvalidOptionsException(
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
                 return $value;
158 158
             })
159
-            ->setNormalizer('admin', function (Options $options, $value) {
159
+            ->setNormalizer('admin', function(Options $options, $value) {
160 160
                 // if a Admin is defined, an Action should be defined too
161 161
                 if ($value && !$options->offsetGet('action')) {
162 162
                     throw new InvalidOptionsException(
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
                 return $value;
168 168
             })
169
-            ->setNormalizer('parameters', function (Options $options, $values) {
169
+            ->setNormalizer('parameters', function(Options $options, $values) {
170 170
                 $cleanedValues = [];
171 171
 
172 172
                 foreach ($values as $name => $method) {
Please login to merge, or discard this patch.
src/Factory/MenuFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     public function __construct(
33 33
         RequestStack $requestStack,
34 34
         ApplicationConfigurationStorage $applicationConfigurationStorage
35
-    ){
35
+    ) {
36 36
         $this->requestStack = $requestStack;
37 37
         $this->applicationConfiguration = $applicationConfigurationStorage->getConfiguration();
38 38
     }
Please login to merge, or discard this patch.
src/Event/Subscriber/ExtraConfigurationSubscriber.php 1 patch
Doc Comments   +8 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,6 +138,10 @@  discard block
 block discarded – undo
138 138
         ];
139 139
     }
140 140
 
141
+    /**
142
+     * @param string $entityClass
143
+     * @param string $adminName
144
+     */
141 145
     private function addDefaultFields(array &$configuration, $entityClass, $adminName)
142 146
     {
143 147
         $fieldsMapping = [
@@ -343,7 +347,7 @@  discard block
 block discarded – undo
343 347
     /**
344 348
      * Return the default action field if found.
345 349
      *
346
-     * @param array $fields
350
+     * @param string[] $fields
347 351
      *
348 352
      * @return string|null
349 353
      */
@@ -420,6 +424,9 @@  discard block
 block discarded – undo
420 424
         return $metadata;
421 425
     }
422 426
 
427
+    /**
428
+     * @param string $type
429
+     */
423 430
     private function getOperatorFromFieldType($type)
424 431
     {
425 432
         $mapping = [
Please login to merge, or discard this patch.