Passed
Pull Request — master (#116)
by Arnaud
03:50
created
src/Configuration/AdminConfiguration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
                 null,
77 77
                 'pagerfanta',
78 78
             ])
79
-            ->setNormalizer('actions', function (Options $options, $actions) {
79
+            ->setNormalizer('actions', function(Options $options, $actions) {
80 80
                 $normalizedActions = [];
81 81
                 $addBatchAction = false;
82 82
 
Please login to merge, or discard this patch.
src/Field/LinkField.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
                 '_self',
47 47
                 '_blank',
48 48
             ])
49
-            ->setNormalizer('route', function (Options $options, $value) use ($actionConfiguration) {
49
+            ->setNormalizer('route', function(Options $options, $value) use ($actionConfiguration) {
50 50
                 // route or url should be defined
51 51
                 if (!$value && !$options->offsetGet('url') && !$options->offsetGet('admin')) {
52 52
                     throw new InvalidOptionsException(
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
                 return $value;
66 66
             })
67
-            ->setNormalizer('admin', function (Options $options, $value) {
67
+            ->setNormalizer('admin', function(Options $options, $value) {
68 68
                 // if a Admin is defined, an Action should be defined too
69 69
                 if ($value && !$options->offsetGet('action')) {
70 70
                     throw new InvalidOptionsException(
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
                 return $value;
76 76
             })
77
-            ->setNormalizer('parameters', function (Options $options, $values) {
77
+            ->setNormalizer('parameters', function(Options $options, $values) {
78 78
                 $cleanedValues = [];
79 79
 
80 80
                 foreach ($values as $name => $method) {
Please login to merge, or discard this patch.
src/Configuration/MenuConfiguration.php 1 patch
Spacing   +5 added lines, -5 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';
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
                 return $value;
79 79
             })
80
-            ->setNormalizer('attr', function (Options $options, $value) {
80
+            ->setNormalizer('attr', function(Options $options, $value) {
81 81
                 $position = $options->offsetGet('position');
82 82
 
83 83
                 if (!key_exists('class', $value)) {
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
                 return $value;
102 102
             })
103
-            ->setNormalizer('item_css_class', function (Options $options, $value) {
103
+            ->setNormalizer('item_css_class', function(Options $options, $value) {
104 104
                 $position = $options->offsetGet('position');
105 105
 
106 106
                 if (!$value) {
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
                 return trim($value);
119 119
             })
120
-            ->setNormalizer('brand', function (Options $options, $value) {
120
+            ->setNormalizer('brand', function(Options $options, $value) {
121 121
                 if (null === $value && 'horizontal' === $options->offsetGet('position')) {
122 122
                     $value = $this->applicationName;
123 123
                 }
Please login to merge, or discard this patch.
src/Configuration/ApplicationConfiguration.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             ->setAllowedTypes('routing_name_pattern', 'string')
87 87
             ->setAllowedTypes('routing_url_pattern', 'string')
88 88
             ->setAllowedTypes('page_parameter', 'string')
89
-            ->setNormalizer('routing_name_pattern', function (Options $options, $value) {
89
+            ->setNormalizer('routing_name_pattern', function(Options $options, $value) {
90 90
                 if (false === strstr($value, '{admin}')) {
91 91
                     throw new InvalidOptionsException(
92 92
                         'Admin routing configuration pattern name should contains the {admin} placeholder'
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
                 return $value;
102 102
             })
103
-            ->setNormalizer('routing_url_pattern', function (Options $options, $value) {
103
+            ->setNormalizer('routing_url_pattern', function(Options $options, $value) {
104 104
                 if (false === strstr($value, '{admin}')) {
105 105
                     throw new InvalidOptionsException('Admin routing configuration url pattern should contains {admin} placeholder');
106 106
                 }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             'pattern' => 'lag.admin.{key}',
127 127
         ]);
128 128
         $resolver->setAllowedTypes('translation', 'array');
129
-        $resolver->setNormalizer('translation', function (Options $options, $value) {
129
+        $resolver->setNormalizer('translation', function(Options $options, $value) {
130 130
             if (!array_key_exists('enabled', $value)) {
131 131
                 throw new InvalidOptionsException('Admin translation enabled parameter should be defined');
132 132
             }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 
169 169
         $resolver->setDefault('fields_mapping', $defaultMapping);
170 170
         $resolver->setAllowedTypes('fields_mapping', 'array');
171
-        $resolver->setNormalizer('fields_mapping', function (Options $options, $value) use ($defaultMapping) {
171
+        $resolver->setNormalizer('fields_mapping', function(Options $options, $value) use ($defaultMapping) {
172 172
             // Merge with default mapping to allow override
173 173
             $value = array_merge($defaultMapping, $value);
174 174
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
         $resolver->setDefault('fields_template_mapping', $defaultMapping);
184 184
         $resolver->setAllowedTypes('fields_template_mapping', 'array');
185
-        $resolver->setNormalizer('fields_template_mapping', function (Options $options, $value) use ($defaultMapping) {
185
+        $resolver->setNormalizer('fields_template_mapping', function(Options $options, $value) use ($defaultMapping) {
186 186
             // Merge with default mapping to allow override
187 187
             $value = array_merge($defaultMapping, $value);
188 188
 
Please login to merge, or discard this patch.
src/Configuration/MenuItemConfiguration.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             ->setDefault('items', [])
56 56
             ->setDefault('icon', null)
57 57
             ->setDefault('link_css_class', 'nav-link')
58
-            ->setNormalizer('admin', function (Options $options, $adminName) {
58
+            ->setNormalizer('admin', function(Options $options, $adminName) {
59 59
                 // user has to defined either an admin name and an action name, or a route name with optional
60 60
                 // parameters, or an url
61 61
                 if (null === $adminName
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                 return $adminName;
71 71
             })
72 72
             // if an admin name is set, an action name can provided. This action will be the menu link
73
-            ->setNormalizer('action', function (Options $options, $action) {
73
+            ->setNormalizer('action', function(Options $options, $action) {
74 74
                 // if an action name is provided, an admin name should be defined too
75 75
                 if (null !== $action && null === $options->offsetGet('admin')) {
76 76
                     throw new InvalidOptionsException(
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                 return $action;
87 87
             })
88 88
             ->setAllowedTypes('parameters', 'array')
89
-            ->setNormalizer('attr', function (Options $options, $attr) {
89
+            ->setNormalizer('attr', function(Options $options, $attr) {
90 90
                 if (!is_array($attr)) {
91 91
                     $attr = [];
92 92
                 }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
                 return $attr;
103 103
             })
104
-            ->setNormalizer('link_attr', function (Options $options, $value) {
104
+            ->setNormalizer('link_attr', function(Options $options, $value) {
105 105
                 if (!is_array($value)) {
106 106
                     $value = [];
107 107
                 }
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
                 return $value;
114 114
             })
115
-            ->setNormalizer('items', function (Options $options, $items) {
115
+            ->setNormalizer('items', function(Options $options, $items) {
116 116
                 if (!is_array($items)) {
117 117
                     $items = [];
118 118
                 }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
                 return $resolvedItems;
131 131
             })
132
-            ->setNormalizer('text', function (Options $options, $text) {
132
+            ->setNormalizer('text', function(Options $options, $text) {
133 133
                 if (!$text) {
134 134
                     // TODO use translation pattern key instead
135 135
                     $text = ucfirst($this->name);
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
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
                 'template' => '@LAGAdmin/Field/actionCollection.html.twig',
26 26
                 'actions' => [],
27 27
             ])
28
-            ->setNormalizer('actions', function (Options $options, $value) use ($actionConfiguration) {
28
+            ->setNormalizer('actions', function(Options $options, $value) use ($actionConfiguration) {
29 29
                 if (!is_array($value) || 0 === count($value)) {
30 30
                     $value = [
31 31
                         'edit' => [],
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                 '_self',
125 125
                 '_blank',
126 126
             ])
127
-            ->setNormalizer('route', function (Options $options, $value) use ($actionConfiguration) {
127
+            ->setNormalizer('route', function(Options $options, $value) use ($actionConfiguration) {
128 128
                 // route or url should be defined
129 129
                 if (!$value && !$options->offsetGet('url') && !$options->offsetGet('admin')) {
130 130
                     throw new InvalidOptionsException(
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
                 return $value;
144 144
             })
145
-            ->setNormalizer('admin', function (Options $options, $value) {
145
+            ->setNormalizer('admin', function(Options $options, $value) {
146 146
                 // if a Admin is defined, an Action should be defined too
147 147
                 if ($value && !$options->offsetGet('action')) {
148 148
                     throw new InvalidOptionsException(
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
                 return $value;
154 154
             })
155
-            ->setNormalizer('parameters', function (Options $options, $values) {
155
+            ->setNormalizer('parameters', function(Options $options, $values) {
156 156
                 $cleanedValues = [];
157 157
 
158 158
                 foreach ($values as $name => $method) {
Please login to merge, or discard this patch.
tests/AdminBundle/Field/Render/FieldRendererTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
 
113 113
     public function testRenderHeaderWithNoMappedField()
114 114
     {
115
-        list($renderer, , ) = $this->createRender();
115
+        list($renderer,,) = $this->createRender();
116 116
 
117 117
         $admin = $this->createMock(ViewInterface::class);
118 118
         $field = $this->createMock(FieldInterface::class);
Please login to merge, or discard this patch.
src/Configuration/ActionConfiguration.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      */
163 163
     private function getFieldsNormalizer()
164 164
     {
165
-        return function (Options $options, $fields) {
165
+        return function(Options $options, $fields) {
166 166
             $normalizedFields = [];
167 167
 
168 168
             foreach ($fields as $name => $field) {
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      */
185 185
     private function getOrderNormalizer()
186 186
     {
187
-        return function (Options $options, $order) {
187
+        return function(Options $options, $order) {
188 188
             foreach ($order as $field => $sort) {
189 189
                 if (!is_string($sort) || !is_string($field) || !in_array(strtolower($sort), ['asc', 'desc'])) {
190 190
                     throw new Exception(
@@ -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 ('create' == $this->actionName) {
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 (false === $menus) {
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) {
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
     private function getRouteDefaultNormalizer(): Closure
323 323
     {
324
-        return function (Options $options, $value) {
324
+        return function(Options $options, $value) {
325 325
             if (!is_array($value)) {
326 326
                 $value = [];
327 327
             }
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 
335 335
     private function getFormNormalizer(): Closure
336 336
     {
337
-        return function (Options $options, $value) {
337
+        return function(Options $options, $value) {
338 338
             if (null !== $value) {
339 339
                 return $value;
340 340
             }
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
             ->getParameter('translation_pattern')
360 360
         ;
361 361
 
362
-        return function (Options $options, $value) use ($translationPattern) {
362
+        return function(Options $options, $value) use ($translationPattern) {
363 363
             if (null === $value) {
364 364
                 $value = 'lag.admin.'.$this->actionName;
365 365
                 $actionName = Container::camelize($this->actionName);
Please login to merge, or discard this patch.
tests/AdminBundle/Event/FormEventTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
         $this->assertCount(1, $event->getForms());
27 27
         $this->assertArrayHasKey('my_panda_form', $event->getForms());
28 28
         $this->assertEquals($form, $event->getForms()['my_panda_form']);
29
-        $this->assertExceptionRaised(Exception::class, function () use ($event, $form) {
29
+        $this->assertExceptionRaised(Exception::class, function() use ($event, $form) {
30 30
             $event->addForm($form, 'my_panda_form');
31 31
         });
32 32
 
Please login to merge, or discard this patch.