@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | ->setAllowedTypes('permissions', 'string') |
109 | 109 | |
110 | 110 | // Translation |
111 | - ->setDefault('translation', function (OptionsResolver $translationResolver) { |
|
111 | + ->setDefault('translation', function(OptionsResolver $translationResolver) { |
|
112 | 112 | $translationResolver |
113 | 113 | ->setDefault('enabled', true) |
114 | 114 | ->setAllowedTypes('enabled', 'boolean') |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | private function getRoutesPatternNormalizer(): Closure |
306 | 306 | { |
307 | - return function (Options $options, $value) { |
|
307 | + return function(Options $options, $value) { |
|
308 | 308 | if (!u($value)->containsAny('{admin}')) { |
309 | 309 | throw new InvalidOptionsException('The routes pattern should contains "{admin}" placeholder. Given '.$value); |
310 | 310 | } |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | |
320 | 320 | private function getFieldsMappingNormalizer(): 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 | } |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | |
331 | 331 | private function getMenusNormalizer(): Closure |
332 | 332 | { |
333 | - return function (Options $options, $value) { |
|
333 | + return function(Options $options, $value) { |
|
334 | 334 | if ($value === null) { |
335 | 335 | $value = []; |
336 | 336 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | 'extras' => ['safe_label' => true], |
38 | 38 | ]) |
39 | 39 | |
40 | - ->setNormalizer('admin', function (Options $options, $adminName) { |
|
40 | + ->setNormalizer('admin', function(Options $options, $adminName) { |
|
41 | 41 | // The user has to defined either an admin name and an action name, or a route name with optional |
42 | 42 | // parameters, or an url |
43 | 43 | if (null === $adminName |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | return $adminName; |
51 | 51 | }) |
52 | 52 | // if an admin name is set, an action name can provided. This action will be the menu link |
53 | - ->setNormalizer('action', function (Options $options, $action) { |
|
53 | + ->setNormalizer('action', function(Options $options, $action) { |
|
54 | 54 | // if an action name is provided, an admin name should be defined too |
55 | 55 | if (null !== $action && null === $options->offsetGet('admin')) { |
56 | 56 | throw new InvalidOptionsException('You should provide an admin name for this action '.$action); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | return $action; |
65 | 65 | }) |
66 | - ->setNormalizer('children', function (Options $options, $items) { |
|
66 | + ->setNormalizer('children', function(Options $options, $items) { |
|
67 | 67 | if (!\is_array($items)) { |
68 | 68 | $items = []; |
69 | 69 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | return $resolvedItems; |
79 | 79 | }) |
80 | - ->setNormalizer('text', function (Options $options, $text) { |
|
80 | + ->setNormalizer('text', function(Options $options, $text) { |
|
81 | 81 | if ($options->offsetGet('admin') && !$text) { |
82 | 82 | $text = u($options->offsetGet('admin'))->replace('_', ' ')->title(true); |
83 | 83 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | return $text; |
100 | 100 | }) |
101 | - ->setNormalizer('linkAttributes', function (Options $options, $linkAttributes) { |
|
101 | + ->setNormalizer('linkAttributes', function(Options $options, $linkAttributes) { |
|
102 | 102 | if (!$linkAttributes) { |
103 | 103 | $linkAttributes = []; |
104 | 104 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | 'inherits' => true, |
28 | 28 | ]) |
29 | 29 | ->setAllowedTypes('inherits', 'boolean') |
30 | - ->setNormalizer('children', function (Options $options, $value) { |
|
30 | + ->setNormalizer('children', function(Options $options, $value) { |
|
31 | 31 | if (!\is_array($value)) { |
32 | 32 | $value = []; |
33 | 33 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | return $value; |
47 | 47 | }) |
48 | - ->setNormalizer('extras', function (Options $options, $extras) { |
|
48 | + ->setNormalizer('extras', function(Options $options, $extras) { |
|
49 | 49 | if (!\is_array($extras)) { |
50 | 50 | $extras = []; |
51 | 51 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | ->setAllowedTypes('menus', 'array') |
107 | 107 | |
108 | 108 | // Translation |
109 | - ->setDefault('translation', function (OptionsResolver $translationResolver) { |
|
109 | + ->setDefault('translation', function(OptionsResolver $translationResolver) { |
|
110 | 110 | $translationResolver |
111 | 111 | ->setDefault('enabled', true) |
112 | 112 | ->setAllowedTypes('enabled', 'boolean') |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | |
289 | 289 | private function getTitleNormalizer(): Closure |
290 | 290 | { |
291 | - return function (Options $options, $value) { |
|
291 | + return function(Options $options, $value) { |
|
292 | 292 | if ($value === null) { |
293 | 293 | if ($options->offsetGet('translation')['enabled']) { |
294 | 294 | $value = u($options->offsetGet('translation')['pattern']) |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | |
308 | 308 | private function getPathNormalizer(): Closure |
309 | 309 | { |
310 | - return function (Options $options, $value) { |
|
310 | + return function(Options $options, $value) { |
|
311 | 311 | if ($value !== null) { |
312 | 312 | $path = u($value); |
313 | 313 | |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | */ |
366 | 366 | private function getFieldsNormalizer(): Closure |
367 | 367 | { |
368 | - return function (Options $options, $fields) { |
|
368 | + return function(Options $options, $fields) { |
|
369 | 369 | $normalizedFields = []; |
370 | 370 | |
371 | 371 | foreach ($fields as $name => $field) { |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | */ |
386 | 386 | private function getOrderNormalizer(): Closure |
387 | 387 | { |
388 | - return function (Options $options, $order) { |
|
388 | + return function(Options $options, $order) { |
|
389 | 389 | foreach ($order as $field => $sort) { |
390 | 390 | if (!\is_string($sort) || !\is_string($field) || !\in_array(strtolower($sort), ['asc', 'desc'])) { |
391 | 391 | throw new Exception('Order value should be an array of string (["field" => $key]), got '.\gettype($sort)); |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | |
399 | 399 | private function getLoadStrategyNormalizer(): Closure |
400 | 400 | { |
401 | - return function (Options $options, $value) { |
|
401 | + return function(Options $options, $value) { |
|
402 | 402 | if ($value !== null) { |
403 | 403 | return $value; |
404 | 404 | } |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | */ |
422 | 422 | private function getCriteriaNormalizer(): Closure |
423 | 423 | { |
424 | - return function (Options $options, $value) { |
|
424 | + return function(Options $options, $value) { |
|
425 | 425 | if (!$value) { |
426 | 426 | $idActions = [ |
427 | 427 | 'edit', |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | */ |
445 | 445 | private function getFiltersNormalizer(): Closure |
446 | 446 | { |
447 | - return function (Options $options, $data) { |
|
447 | + return function(Options $options, $data) { |
|
448 | 448 | $normalizedData = []; |
449 | 449 | |
450 | 450 | foreach ($data as $name => $field) { |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | |
471 | 471 | private function getFormNormalizer(): Closure |
472 | 472 | { |
473 | - return function (Options $options, $value) { |
|
473 | + return function(Options $options, $value) { |
|
474 | 474 | if ($value !== null && $value !== false) { |
475 | 475 | return $value; |
476 | 476 | } |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | |
495 | 495 | private function getRouteParametersNormalizer(): Closure |
496 | 496 | { |
497 | - return function (Options $options, $value) { |
|
497 | + return function(Options $options, $value) { |
|
498 | 498 | if (\count($value) > 0) { |
499 | 499 | return $value; |
500 | 500 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | ->environment |
95 | 95 | ->expects($this->once()) |
96 | 96 | ->method('render') |
97 | - ->willReturnCallback(function () { |
|
97 | + ->willReturnCallback(function() { |
|
98 | 98 | throw new Exception(); |
99 | 99 | }) |
100 | 100 | ; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | ->environment |
124 | 124 | ->expects($this->once()) |
125 | 125 | ->method('render') |
126 | - ->willReturnCallback(function (string $template, array $options) use ($name, $expectedLabel) { |
|
126 | + ->willReturnCallback(function(string $template, array $options) use ($name, $expectedLabel) { |
|
127 | 127 | $this->assertEquals('@LAGAdmin/fields/header.html.twig', $template); |
128 | 128 | |
129 | 129 | $this->assertArrayHasKey('data', $options); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | ->environment |
183 | 183 | ->expects($this->once()) |
184 | 184 | ->method('render') |
185 | - ->willReturnCallback(function (string $template, array $options) { |
|
185 | + ->willReturnCallback(function(string $template, array $options) { |
|
186 | 186 | throw new Exception(); |
187 | 187 | }) |
188 | 188 | ; |
@@ -24,7 +24,7 @@ |
||
24 | 24 | ->eventDispatcher |
25 | 25 | ->expects($this->exactly(3)) |
26 | 26 | ->method('dispatch') |
27 | - ->willReturnCallback(function ($event) { |
|
27 | + ->willReturnCallback(function($event) { |
|
28 | 28 | /* @var FieldEvent $event */ |
29 | 29 | $this->assertInstanceOf(FieldEvent::class, $event); |
30 | 30 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | ->eventDispatcher |
47 | 47 | ->expects($this->once()) |
48 | 48 | ->method('dispatch') |
49 | - ->willReturnCallback(function ($event, $eventName) { |
|
49 | + ->willReturnCallback(function($event, $eventName) { |
|
50 | 50 | $this->assertInstanceOf(AdminEvent::class, $event); |
51 | 51 | $this->assertEquals(AdminEvents::ADMIN_CREATE, $eventName); |
52 | 52 |
@@ -65,7 +65,7 @@ |
||
65 | 65 | ->eventDispatcher |
66 | 66 | ->expects($this->once()) |
67 | 67 | ->method('dispatch') |
68 | - ->willReturn(function ($actionEvent, $eventName) { |
|
68 | + ->willReturn(function($actionEvent, $eventName) { |
|
69 | 69 | $this->assertInstanceOf(ActionEvent::class, $actionEvent); |
70 | 70 | $this->assertEquals(AdminEvents::ACTION_CREATE, $eventName); |
71 | 71 | }) |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | // Several methods are tested in this test as testing some methods as getData() or reset() without data is |
20 | 20 | // useless |
21 | - [$collector, $registry, $storage,] = $this->createCollector(); |
|
21 | + [$collector, $registry, $storage, ] = $this->createCollector(); |
|
22 | 22 | |
23 | 23 | $this->assertEquals('admin.data_collector', $collector->getName()); |
24 | 24 | $this->assertEquals([], $collector->getData()); |