Completed
Pull Request — master (#153)
by Arnaud
03:45
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/Factory/FormFactory.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -120,13 +120,13 @@  discard block
 block discarded – undo
120 120
         if ('array' === $type) {
121 121
             $builder
122 122
                 ->get($field)
123
-                ->addModelTransformer(new CallbackTransformer(function (?array $value = null) {
123
+                ->addModelTransformer(new CallbackTransformer(function(?array $value = null) {
124 124
                     if (null === $value) {
125 125
                         $value = [];
126 126
                     }
127 127
 
128 128
                     return Yaml::dump($value);
129
-                }, function ($value) {
129
+                }, function($value) {
130 130
                     if (null === $value) {
131 131
                         return [];
132 132
                     }
@@ -139,13 +139,13 @@  discard block
 block discarded – undo
139 139
         if ('simple_array' === $type) {
140 140
             $builder
141 141
                 ->get($field)
142
-                ->addModelTransformer(new CallbackTransformer(function (?array $value = null) {
142
+                ->addModelTransformer(new CallbackTransformer(function(?array $value = null) {
143 143
                     if (null === $value) {
144 144
                         $value = [];
145 145
                     }
146 146
 
147 147
                     return implode(',', $value);
148
-                }, function ($value) {
148
+                }, function($value) {
149 149
                     if (null === $value) {
150 150
                         return [];
151 151
                     }
Please login to merge, or discard this patch.
src/Field/ActionField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
         $resolver
25 25
             ->setDefault('class', '')
26
-            ->setNormalizer('class', function (Options $options, $value) {
26
+            ->setNormalizer('class', function(Options $options, $value) {
27 27
                 if ($value) {
28 28
                     return $value;
29 29
                 }
Please login to merge, or discard this patch.
src/Field/ActionCollectionField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
                 'template' => '@LAGAdmin/Field/actionCollection.html.twig',
32 32
                 'actions' => [],
33 33
             ])
34
-            ->setNormalizer('actions', function (Options $options, $value) use ($actionConfiguration) {
34
+            ->setNormalizer('actions', function(Options $options, $value) use ($actionConfiguration) {
35 35
                 if (!is_array($value) || 0 === count($value)) {
36 36
                     $value = [
37 37
                         'edit' => [],
Please login to merge, or discard this patch.
tests/AdminBundle/Factory/ViewFactoryTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -226,7 +226,7 @@
 block discarded – undo
226 226
      */
227 227
     public function testCreateRedirectionWithException()
228 228
     {
229
-        list($factory, , ,) = $this->createFactory();
229
+        list($factory,,,) = $this->createFactory();
230 230
 
231 231
         $request = $this->createMock(Request::class);
232 232
         $adminConfiguration = $this->createMock(AdminConfiguration::class);
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
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
             ->setDefault('items', [])
54 54
             ->setDefault('icon', null)
55 55
             ->setDefault('link_css_class', 'nav-link')
56
-            ->setNormalizer('admin', function (Options $options, $adminName) {
56
+            ->setNormalizer('admin', function(Options $options, $adminName) {
57 57
                 // user has to defined either an admin name and an action name, or a route name with optional
58 58
                 // parameters, or an url
59 59
                 if (null === $adminName
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
                 return $adminName;
67 67
             })
68 68
             // if an admin name is set, an action name can provided. This action will be the menu link
69
-            ->setNormalizer('action', function (Options $options, $action) {
69
+            ->setNormalizer('action', function(Options $options, $action) {
70 70
                 // if an action name is provided, an admin name should be defined too
71 71
                 if (null !== $action && null === $options->offsetGet('admin')) {
72 72
                     throw new InvalidOptionsException('You should provide an admin name for this action '.$action);
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
                 return $action;
81 81
             })
82 82
             ->setAllowedTypes('parameters', 'array')
83
-            ->setNormalizer('attr', function (Options $options, $attr) {
83
+            ->setNormalizer('attr', function(Options $options, $attr) {
84 84
                 if (!is_array($attr)) {
85 85
                     $attr = [];
86 86
                 }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
                 return $attr;
97 97
             })
98
-            ->setNormalizer('link_attr', function (Options $options, $value) {
98
+            ->setNormalizer('link_attr', function(Options $options, $value) {
99 99
                 if (!is_array($value)) {
100 100
                     $value = [];
101 101
                 }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
                 return $value;
108 108
             })
109
-            ->setNormalizer('items', function (Options $options, $items) {
109
+            ->setNormalizer('items', function(Options $options, $items) {
110 110
                 if (!is_array($items)) {
111 111
                     $items = [];
112 112
                 }
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
                 return $resolvedItems;
125 125
             })
126
-            ->setNormalizer('text', function (Options $options, $text) {
126
+            ->setNormalizer('text', function(Options $options, $text) {
127 127
                 if ($text) {
128 128
                     return $text;
129 129
                 }
Please login to merge, or discard this patch.
src/Field/LinkField.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
                 '_self',
57 57
                 '_blank',
58 58
             ])
59
-            ->setNormalizer('route', function (Options $options, $value) use ($actionConfiguration) {
59
+            ->setNormalizer('route', function(Options $options, $value) use ($actionConfiguration) {
60 60
                 // route or url should be defined
61 61
                 if (!$value && !$options->offsetGet('url') && !$options->offsetGet('admin')) {
62 62
                     throw new InvalidOptionsException('Either an url or a route should be defined');
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
                 return $value;
74 74
             })
75
-            ->setNormalizer('admin', function (Options $options, $value) {
75
+            ->setNormalizer('admin', function(Options $options, $value) {
76 76
                 // if a Admin is defined, an Action should be defined too
77 77
                 if ($value && !$options->offsetGet('action')) {
78 78
                     throw new InvalidOptionsException('An Action should be provided if an Admin is provided');
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
                 return $value;
82 82
             })
83
-            ->setNormalizer('parameters', function (Options $options, $values) {
83
+            ->setNormalizer('parameters', function(Options $options, $values) {
84 84
                 $cleanedValues = [];
85 85
 
86 86
                 foreach ($values as $name => $method) {
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
                 return $cleanedValues;
94 94
             })
95
-            ->setNormalizer('text', function (Options $options, $value) use ($actionConfiguration) {
95
+            ->setNormalizer('text', function(Options $options, $value) use ($actionConfiguration) {
96 96
                 if ($value) {
97 97
                     return $value;
98 98
                 }
Please login to merge, or discard this patch.
src/Configuration/ApplicationConfiguration.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
             ->setAllowedTypes('routing_name_pattern', 'string')
88 88
             ->setAllowedTypes('routing_url_pattern', 'string')
89 89
             ->setAllowedTypes('page_parameter', 'string')
90
-            ->setNormalizer('routing_name_pattern', function (Options $options, $value) {
90
+            ->setNormalizer('routing_name_pattern', function(Options $options, $value) {
91 91
                 if (false === strstr($value, '{admin}')) {
92 92
                     throw new InvalidOptionsException('Admin routing configuration pattern name should contains the {admin} placeholder');
93 93
                 }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
                 return $value;
99 99
             })
100
-            ->setNormalizer('routing_url_pattern', function (Options $options, $value) {
100
+            ->setNormalizer('routing_url_pattern', function(Options $options, $value) {
101 101
                 if (false === strstr($value, '{admin}')) {
102 102
                     throw new InvalidOptionsException('Admin routing configuration url pattern should contains {admin} placeholder');
103 103
                 }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
         $resolver->setDefault('fields_mapping', $defaultMapping);
137 137
         $resolver->setAllowedTypes('fields_mapping', 'array');
138
-        $resolver->setNormalizer('fields_mapping', function (Options $options, $value) use ($defaultMapping) {
138
+        $resolver->setNormalizer('fields_mapping', function(Options $options, $value) use ($defaultMapping) {
139 139
             // Merge with default mapping to allow override
140 140
             $value = array_merge($defaultMapping, $value);
141 141
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
         $resolver->setDefault('fields_template_mapping', $defaultMapping);
151 151
         $resolver->setAllowedTypes('fields_template_mapping', 'array');
152
-        $resolver->setNormalizer('fields_template_mapping', function (Options $options, $value) use ($defaultMapping) {
152
+        $resolver->setNormalizer('fields_template_mapping', function(Options $options, $value) use ($defaultMapping) {
153 153
             // Merge with default mapping to allow override
154 154
             $value = array_merge($defaultMapping, $value);
155 155
 
Please login to merge, or discard this patch.
src/Configuration/Behavior/TranslationConfigurationTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     {
15 15
         $resolver
16 16
             ->setDefaults([
17
-                'translation' => function (OptionsResolver $subResolver) use ($pattern, $catalog) {
17
+                'translation' => function(OptionsResolver $subResolver) use ($pattern, $catalog) {
18 18
                     $subResolver
19 19
                         ->setDefaults([
20 20
                             'enabled' => true,
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
                 },
26 26
             ])
27 27
             ->setAllowedTypes('translation', 'array')
28
-            ->setNormalizer('translation', function (Options $options, $value) {
28
+            ->setNormalizer('translation', function(Options $options, $value) {
29 29
                 if (!array_key_exists('enabled', $value)) {
30 30
                     throw new InvalidOptionsException('Admin translation enabled parameter should be defined');
31 31
                 }
Please login to merge, or discard this patch.