Passed
Pull Request — master (#300)
by Arnaud
15:59
created
tests/phpunit/Factory/FieldFactoryTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
             ->eventDispatcher
25 25
             ->expects($this->exactly(3))
26 26
             ->method('dispatch')
27
-            ->willReturnCallback(function ($event) {
27
+            ->willReturnCallback(function($event) {
28 28
                 if ($event instanceof FieldEvent) {
29 29
                     $this->assertEquals([
30 30
                         'template' => 'string.html.twig',
Please login to merge, or discard this patch.
tests/phpunit/Admin/Helper/AdminHelperTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     {
14 14
         $helper = new AdminHelper();
15 15
 
16
-        $this->assertExceptionRaised(Exception::class, function () use ($helper) {
16
+        $this->assertExceptionRaised(Exception::class, function() use ($helper) {
17 17
             $helper->getAdmin();
18 18
         });
19 19
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
         $this->assertEquals($admin, $helper->getAdmin());
24 24
 
25
-        $this->assertExceptionRaised(Exception::class, function () use ($helper, $admin) {
25
+        $this->assertExceptionRaised(Exception::class, function() use ($helper, $admin) {
26 26
             $helper->setAdmin($admin);
27 27
         });
28 28
     }
Please login to merge, or discard this patch.
tests/phpunit/Admin/AdminTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         $this->eventDispatcher
37 37
             ->expects($this->exactly(4))
38 38
             ->method('dispatch')
39
-            ->willReturnCallback(function ($event, $eventName) use ($action, $form, $entities) {
39
+            ->willReturnCallback(function($event, $eventName) use ($action, $form, $entities) {
40 40
                 if (AdminEvents::ADMIN_REQUEST === $eventName) {
41 41
                     $this->assertInstanceOf(RequestEvent::class, $event);
42 42
                     $event->setAction($action);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
         $request = new Request();
61 61
 
62
-        $this->assertExceptionRaised(Exception::class, function () {
62
+        $this->assertExceptionRaised(Exception::class, function() {
63 63
             $this->admin->getRequest();
64 64
         });
65 65
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $this->assertCount(2, $this->admin->getForms());
79 79
         $this->assertEquals($form, $this->admin->getForms()['entity']);
80 80
         $this->assertEquals($form, $this->admin->getForm('entity'));
81
-        $this->assertExceptionRaised(Exception::class, function () {
81
+        $this->assertExceptionRaised(Exception::class, function() {
82 82
             $this->admin->getForm('invalid');
83 83
         });
84 84
     }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         ;
100 100
         $request = new Request();
101 101
 
102
-        $this->assertExceptionRaised(Exception::class, function () use ($request) {
102
+        $this->assertExceptionRaised(Exception::class, function() use ($request) {
103 103
             $this->admin->handleRequest($request);
104 104
         });
105 105
     }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $this->eventDispatcher
112 112
             ->expects($this->once())
113 113
             ->method('dispatch')
114
-            ->willReturnCallback(function ($event, $eventName) use ($view) {
114
+            ->willReturnCallback(function($event, $eventName) use ($view) {
115 115
                 $this->assertEquals(AdminEvents::ADMIN_VIEW, $eventName);
116 116
                 $this->assertInstanceOf(ViewEvent::class, $event);
117 117
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         $eventDispatcher
154 154
             ->expects($this->exactly(4))
155 155
             ->method('dispatch')
156
-            ->willReturnCallback(function ($event, $eventName) use ($action) {
156
+            ->willReturnCallback(function($event, $eventName) use ($action) {
157 157
                 $this->assertContains($eventName, [
158 158
                     AdminEvents::ADMIN_REQUEST,
159 159
                     AdminEvents::ADMIN_DATA,
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         $this->eventDispatcher
189 189
             ->expects($this->exactly(4))
190 190
             ->method('dispatch')
191
-            ->willReturnCallback(function ($event, $eventName) use ($action, $form) {
191
+            ->willReturnCallback(function($event, $eventName) use ($action, $form) {
192 192
                 if (AdminEvents::ADMIN_REQUEST === $eventName) {
193 193
                     $this->assertInstanceOf(RequestEvent::class, $event);
194 194
                     $event->setAction($action);
Please login to merge, or discard this patch.
src/Event/Listener/Data/CreateDataFilterListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
                 }
46 46
 
47 47
                 if (\is_array($data[$name])) {
48
-                    $check = array_filter($data[$name], function ($value) {
48
+                    $check = array_filter($data[$name], function($value) {
49 49
                         return $value !== null;
50 50
                     });
51 51
 
Please login to merge, or discard this patch.
src/Form/Type/TinyMce/TinyMceType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
                 'custom_buttons' => [],
29 29
             ])
30 30
             ->setAllowedTypes('tinymce_options', 'array')
31
-            ->addNormalizer('tinymce_options', function (Options $options, $value) {
31
+            ->addNormalizer('tinymce_options', function(Options $options, $value) {
32 32
                 $attr = $options->offsetGet('attr');
33 33
 
34 34
                 if (\array_key_exists('id', $attr)) {
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
                 return array_replace_recursive($this->getTinyMceDefaultConfiguration(), $value);
42 42
             })
43 43
             ->setAllowedTypes('custom_buttons', 'array')
44
-            ->addNormalizer('custom_buttons', function (Options $options, $value) {
44
+            ->addNormalizer('custom_buttons', function(Options $options, $value) {
45 45
                 foreach ($value as $item => $button) {
46 46
                     $buttonResolver = new OptionsResolver();
47 47
                     $buttonResolver->setDefaults([
Please login to merge, or discard this patch.
src/Routing/Parameter/ParametersMapper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
         $mappedRouteParameters = [];
13 13
 
14 14
         foreach ($routeParameters as $parameter => $requirements) {
15
-            $mappedRouteParameters[$parameter] = $accessor->getValue($data, (string)$parameter);
15
+            $mappedRouteParameters[$parameter] = $accessor->getValue($data, (string) $parameter);
16 16
         }
17 17
 
18 18
         return $mappedRouteParameters;
Please login to merge, or discard this patch.
src/Admin/Configuration/AdminConfiguration.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
             ->setAllowedTypes('name', 'string')
31 31
             ->setDefault('title', null)
32 32
             ->setAllowedTypes('title', ['string', 'null'])
33
-            ->addNormalizer('title', function (Options $options, $value) {
33
+            ->addNormalizer('title', function(Options $options, $value) {
34 34
                 if ($value === null) {
35 35
                     $value = u($options->offsetGet('name'))->title()->toString();
36 36
                 }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                 'delete' => [],
53 53
             ])
54 54
             ->setAllowedTypes('list_actions', 'array')
55
-            ->setNormalizer('list_actions', function (Options $options, $value) {
55
+            ->setNormalizer('list_actions', function(Options $options, $value) {
56 56
                 foreach ($value as $actionName => $actionConfiguration) {
57 57
                     $value[$actionName] = LinkNormalizer::normalize(
58 58
                         $actionConfiguration,
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                 'create' => [],
69 69
             ])
70 70
             ->setAllowedTypes('item_actions', 'array')
71
-            ->setNormalizer('item_actions', function (Options $options, $value) {
71
+            ->setNormalizer('item_actions', function(Options $options, $value) {
72 72
                 foreach ($value as $actionName => $actionConfiguration) {
73 73
                     $value[$actionName] = LinkNormalizer::normalize(
74 74
                         $actionConfiguration,
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 
275 275
     private function getActionNormalizer(): Closure
276 276
     {
277
-        return function (Options $options, $actions) {
277
+        return function(Options $options, $actions) {
278 278
             $normalizedActions = [];
279 279
 //            $addBatchAction = false;
280 280
 
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 
311 311
     private function getRoutesPatternNormalizer(): Closure
312 312
     {
313
-        return function (Options $options, $value) {
313
+        return function(Options $options, $value) {
314 314
             if (!u($value)->containsAny('{action}')) {
315 315
                 throw new InvalidOptionsException(sprintf('The "%s" parameters in admin "%s" should contains the "%s" parameters', 'routes_pattern', $options->offsetGet('name'), '{action}'));
316 316
             }
Please login to merge, or discard this patch.
src/Admin/Configuration/ApplicationConfiguration.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
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')
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 
291 291
     private function getRoutesPatternNormalizer(): Closure
292 292
     {
293
-        return function (Options $options, $value) {
293
+        return function(Options $options, $value) {
294 294
             if (!u($value)->containsAny('{admin}')) {
295 295
                 throw new InvalidOptionsException('The routes pattern should contains "{admin}" placeholder. Given '.$value);
296 296
             }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 
306 306
     private function getFieldsMappingNormalizer(): Closure
307 307
     {
308
-        return function (Options $options, $value) {
308
+        return function(Options $options, $value) {
309 309
             if (!\is_array($value)) {
310 310
                 $value = [];
311 311
             }
Please login to merge, or discard this patch.
src/Admin/Configuration/ActionConfiguration.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                 'delete' => [],
46 46
             ])
47 47
             ->setAllowedTypes('list_actions', 'array')
48
-            ->setNormalizer('list_actions', function (Options $options, $value) {
48
+            ->setNormalizer('list_actions', function(Options $options, $value) {
49 49
                 foreach ($value as $actionName => $actionConfiguration) {
50 50
                     $value[$actionName] = LinkNormalizer::normalize(
51 51
                         $actionConfiguration,
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                 'create' => [],
62 62
             ])
63 63
             ->setAllowedTypes('item_actions', 'array')
64
-            ->setNormalizer('item_actions', function (Options $options, $value) {
64
+            ->setNormalizer('item_actions', function(Options $options, $value) {
65 65
                 foreach ($value as $actionName => $actionConfiguration) {
66 66
                     $value[$actionName] = LinkNormalizer::normalize(
67 67
                         $actionConfiguration,
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 
308 308
     private function getTitleNormalizer(): Closure
309 309
     {
310
-        return function (Options $options, $value) {
310
+        return function(Options $options, $value) {
311 311
             if ($value === null) {
312 312
                 $value = u($options->offsetGet('name'))->camel()->title()->toString();
313 313
             }
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
     private function getTemplateNormalizer(): Closure
320 320
     {
321
-        return function (Options $options, $value) {
321
+        return function(Options $options, $value) {
322 322
             $map = [
323 323
                 'create' => '@LAGAdmin/crud/create.html.twig',
324 324
                 'edit' => '@LAGAdmin/crud/edit.html.twig',
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 
340 340
     private function getPathNormalizer(): Closure
341 341
     {
342
-        return function (Options $options, $value) {
342
+        return function(Options $options, $value) {
343 343
             if ($value !== null) {
344 344
                 $path = u($value);
345 345
 
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
      */
399 399
     private function getFieldsNormalizer(): Closure
400 400
     {
401
-        return function (Options $options, $fields) {
401
+        return function(Options $options, $fields) {
402 402
             $normalizedFields = [];
403 403
 
404 404
             foreach ($fields as $name => $field) {
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
      */
419 419
     private function getOrderNormalizer(): Closure
420 420
     {
421
-        return function (Options $options, $order) {
421
+        return function(Options $options, $order) {
422 422
             foreach ($order as $field => $sort) {
423 423
                 if (!\is_string($sort) || !\is_string($field) || !\in_array(strtolower($sort), ['asc', 'desc'])) {
424 424
                     throw new Exception('Order value should be an array of string (["field" => $key]), got '.\gettype($sort));
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 
432 432
     private function getLoadStrategyNormalizer(): Closure
433 433
     {
434
-        return function (Options $options, $value) {
434
+        return function(Options $options, $value) {
435 435
             if ($value !== null) {
436 436
                 return $value;
437 437
             }
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
      */
455 455
     private function getCriteriaNormalizer(): Closure
456 456
     {
457
-        return function (Options $options, $value) {
457
+        return function(Options $options, $value) {
458 458
             if (!$value) {
459 459
                 $idActions = [
460 460
                     'edit',
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
      */
478 478
     private function getFiltersNormalizer(): Closure
479 479
     {
480
-        return function (Options $options, $data) {
480
+        return function(Options $options, $data) {
481 481
             $normalizedData = [];
482 482
 
483 483
             foreach ($data as $name => $field) {
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 
504 504
     private function getRouteParametersNormalizer(): Closure
505 505
     {
506
-        return function (Options $options, $value) {
506
+        return function(Options $options, $value) {
507 507
             if (\count($value) > 0) {
508 508
                 return $value;
509 509
             }
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 
519 519
     private function getLinkedActionsNormalizer(): Closure
520 520
     {
521
-        return function (Options $options, $value) {
521
+        return function(Options $options, $value) {
522 522
             $actions = array_keys($options->offsetGet('actions'));
523 523
 
524 524
             foreach ($value as $actionName) {
Please login to merge, or discard this patch.