Passed
Pull Request — master (#106)
by Arnaud
04:49 queued 02:37
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.
tests/AdminBundle/Factory/ActionFactoryTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         $configurationFactory
47 47
             ->expects($this->once())
48 48
             ->method('createActionConfiguration')
49
-            ->with('list',  [], 'tauntaun', $adminConfiguration)
49
+            ->with('list', [], 'tauntaun', $adminConfiguration)
50 50
             ->willReturn($actionConfiguration)
51 51
         ;
52 52
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             ])
82 82
         ;
83 83
 
84
-        $this->assertExceptionRaised(Exception::class, function () use ($factory, $adminConfiguration) {
84
+        $this->assertExceptionRaised(Exception::class, function() use ($factory, $adminConfiguration) {
85 85
             $factory->create('list', 'tauntaun', $adminConfiguration);
86 86
         });
87 87
     }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         $configurationFactory
118 118
             ->expects($this->once())
119 119
             ->method('createActionConfiguration')
120
-            ->with('list',  [], 'tauntaun', $adminConfiguration)
120
+            ->with('list', [], 'tauntaun', $adminConfiguration)
121 121
             ->willReturn($actionConfiguration)
122 122
         ;
123 123
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             $configurationFactory
128 128
         );
129 129
 
130
-        $this->assertExceptionRaised(Exception::class, function () use ($factory, $adminConfiguration) {
130
+        $this->assertExceptionRaised(Exception::class, function() use ($factory, $adminConfiguration) {
131 131
             $factory->create('list', 'tauntaun', $adminConfiguration);
132 132
         });
133 133
     }
Please login to merge, or discard this patch.
tests/AdminBundle/DependencyInjection/LAGAdminExtensionTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
         $builder
18 18
             ->expects($this->atLeastOnce())
19 19
             ->method('setParameter')
20
-            ->willReturnCallback(function ($parameter, $value) {
20
+            ->willReturnCallback(function($parameter, $value) {
21 21
                 $this->assertContains($parameter, [
22 22
                     'lag.admin.enable_extra_configuration',
23 23
                     'lag.admin.application_configuration',
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/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/Configuration/ActionConfiguration.php 1 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) {
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
      */
181 181
     private function getOrderNormalizer()
182 182
     {
183
-        return function (Options $options, $order) {
183
+        return function(Options $options, $order) {
184 184
             foreach ($order as $field => $sort) {
185 185
                 if (!is_string($sort) || !is_string($field) || !in_array(strtolower($sort), ['asc', 'desc'])) {
186 186
                     throw new Exception(
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      */
204 204
     private function getLoadStrategyNormalizer()
205 205
     {
206
-        return function (Options $options, $value) {
206
+        return function(Options $options, $value) {
207 207
             if (!$value) {
208 208
                 if ('create' == $this->actionName) {
209 209
                     $value = LAGAdminBundle::LOAD_STRATEGY_NONE;
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
      */
227 227
     private function getMenuNormalizer()
228 228
     {
229
-        return function (Options $options, $menus) {
229
+        return function(Options $options, $menus) {
230 230
             // set default to an array
231 231
             if (false === $menus) {
232 232
                 $menus = [];
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
      */
245 245
     private function getCriteriaNormalizer()
246 246
     {
247
-        return function (Options $options, $value) {
247
+        return function(Options $options, $value) {
248 248
             if (!$value) {
249 249
                 $idActions = [
250 250
                     'edit',
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
      */
294 294
     private function getFiltersNormalizer(): Closure
295 295
     {
296
-        return function (Options $options, $data) {
296
+        return function(Options $options, $data) {
297 297
             $normalizedData = [];
298 298
 
299 299
             foreach ($data as $name => $field) {
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 
320 320
     private function getRouteDefaultNormalizer(): Closure
321 321
     {
322
-        return function (Options $options, $value) {
322
+        return function(Options $options, $value) {
323 323
             if (!is_array($value)) {
324 324
                 $value = [];
325 325
             }
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
     private function getFormNormalizer(): Closure
334 334
     {
335
-        return function (Options $options, $value) {
335
+        return function(Options $options, $value) {
336 336
             if (null !== $value) {
337 337
                 return $value;
338 338
             }
Please login to merge, or discard this patch.