@@ -15,11 +15,11 @@ |
||
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 | /** |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | private function getFieldsNormalizer() |
166 | 166 | { |
167 | - return function (Options $options, $fields) { |
|
167 | + return function(Options $options, $fields) { |
|
168 | 168 | $normalizedFields = []; |
169 | 169 | |
170 | 170 | foreach ($fields as $name => $field) { |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | */ |
188 | 188 | private function getOrderNormalizer() |
189 | 189 | { |
190 | - return function (Options $options, $order) { |
|
190 | + return function(Options $options, $order) { |
|
191 | 191 | foreach ($order as $field => $sort) { |
192 | 192 | |
193 | 193 | if (!is_string($sort) || !is_string($field) || !in_array(strtolower($sort), ['asc', 'desc'])) { |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | */ |
212 | 212 | private function getLoadStrategyNormalizer() |
213 | 213 | { |
214 | - return function (Options $options, $value) { |
|
214 | + return function(Options $options, $value) { |
|
215 | 215 | if (!$value) { |
216 | 216 | if ($this->actionName == 'create') { |
217 | 217 | $value = LAGAdminBundle::LOAD_STRATEGY_NONE; |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | */ |
235 | 235 | private function getMenuNormalizer() |
236 | 236 | { |
237 | - return function (Options $options, $menus) { |
|
237 | + return function(Options $options, $menus) { |
|
238 | 238 | // set default to an array |
239 | 239 | if ($menus === false) { |
240 | 240 | $menus = []; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | */ |
253 | 253 | private function getCriteriaNormalizer() |
254 | 254 | { |
255 | - return function (Options $options, $value) { |
|
255 | + return function(Options $options, $value) { |
|
256 | 256 | if (!$value) { |
257 | 257 | $idActions = [ |
258 | 258 | 'edit', |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | */ |
302 | 302 | private function getFiltersNormalizer() |
303 | 303 | { |
304 | - return function (Options $options, $data) { |
|
304 | + return function(Options $options, $data) { |
|
305 | 305 | $normalizedData = []; |
306 | 306 | |
307 | 307 | foreach ($data as $name => $field) { |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | |
328 | 328 | private function getRouteDefaultNormalizer() |
329 | 329 | { |
330 | - return function (Options $options, $value) { |
|
330 | + return function(Options $options, $value) { |
|
331 | 331 | if (!is_array($value)) { |
332 | 332 | $value = []; |
333 | 333 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $eventDispatcher |
48 | 48 | ->expects($this->exactly(5)) |
49 | 49 | ->method('dispatch') |
50 | - ->willReturnCallback(function ($eventName, $event) use ($action, $form) { |
|
50 | + ->willReturnCallback(function($eventName, $event) use ($action, $form) { |
|
51 | 51 | if (AdminEvents::HANDLE_REQUEST === $eventName) { |
52 | 52 | /** @var AdminEvent $event */ |
53 | 53 | $this->assertInstanceOf(AdminEvent::class, $event); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | ); |
113 | 113 | $request = new Request(); |
114 | 114 | |
115 | - $this->assertExceptionRaised(Exception::class, function () use ($admin, $request) { |
|
115 | + $this->assertExceptionRaised(Exception::class, function() use ($admin, $request) { |
|
116 | 116 | $admin->handleRequest($request); |
117 | 117 | }); |
118 | 118 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $eventDispatcher |
128 | 128 | ->expects($this->once()) |
129 | 129 | ->method('dispatch') |
130 | - ->willReturnCallback(function ($eventName, $event) use ($view) { |
|
130 | + ->willReturnCallback(function($eventName, $event) use ($view) { |
|
131 | 131 | $this->assertEquals(AdminEvents::VIEW, $eventName); |
132 | 132 | /** @var ViewEvent $event */ |
133 | 133 | $this->assertInstanceOf(ViewEvent::class, $event); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $eventDispatcher |
179 | 179 | ->expects($this->exactly(4)) |
180 | 180 | ->method('dispatch') |
181 | - ->willReturnCallback(function ($eventName, $event) use ($action, $form) { |
|
181 | + ->willReturnCallback(function($eventName, $event) use ($action, $form) { |
|
182 | 182 | if (AdminEvents::HANDLE_REQUEST === $eventName) { |
183 | 183 | /** @var AdminEvent $event */ |
184 | 184 | $this->assertInstanceOf(AdminEvent::class, $event); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $eventDispatcher |
209 | 209 | ->expects($this->exactly(4)) |
210 | 210 | ->method('dispatch') |
211 | - ->willReturnCallback(function ($eventName, $event) use ($action, $form) { |
|
211 | + ->willReturnCallback(function($eventName, $event) use ($action, $form) { |
|
212 | 212 | if (AdminEvents::HANDLE_REQUEST === $eventName) { |
213 | 213 | /** @var AdminEvent $event */ |
214 | 214 | $this->assertInstanceOf(AdminEvent::class, $event); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | $eventDispatcher |
35 | 35 | ->expects($this->once()) |
36 | 36 | ->method('dispatch') |
37 | - ->willReturnCallback(function ($eventName, $event) { |
|
37 | + ->willReturnCallback(function($eventName, $event) { |
|
38 | 38 | $this->assertEquals(AdminEvents::MENU, $eventName); |
39 | 39 | $this->assertInstanceOf(MenuEvent::class, $event); |
40 | 40 | }) |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | $event = new AdminEvent($admin, $request); |
108 | 108 | |
109 | - $this->assertExceptionRaised(Exception::class, function () use ($subscriber, $event) { |
|
109 | + $this->assertExceptionRaised(Exception::class, function() use ($subscriber, $event) { |
|
110 | 110 | $subscriber->handleRequest($event); |
111 | 111 | }); |
112 | 112 | } |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | $request = new Request(); |
519 | 519 | $event = new EntityEvent($admin, $request); |
520 | 520 | |
521 | - $this->assertExceptionRaised(Exception::class, function () use ($subscriber, $event) { |
|
521 | + $this->assertExceptionRaised(Exception::class, function() use ($subscriber, $event) { |
|
522 | 522 | $subscriber->loadEntities($event); |
523 | 523 | }); |
524 | 524 | } |
@@ -46,7 +46,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -82,7 +82,7 @@ |
||
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); |
@@ -17,7 +17,7 @@ |
||
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', |
@@ -119,7 +119,7 @@ |
||
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); |
@@ -53,7 +53,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |