@@ -120,13 +120,13 @@ discard block |
||
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 |
||
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 | } |
@@ -23,7 +23,7 @@ |
||
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 | } |
@@ -31,7 +31,7 @@ |
||
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' => [], |
@@ -56,7 +56,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -14,7 +14,7 @@ discard block |
||
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 |
||
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 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | $environment = $this->createMock(Environment::class); |
15 | 15 | $registry = new ScriptRegistry($environment); |
16 | 16 | |
17 | - $this->assertExceptionRaised(Exception::class, function () use ($registry) { |
|
17 | + $this->assertExceptionRaised(Exception::class, function() use ($registry) { |
|
18 | 18 | $registry->unregister('footer', 'test.js'); |
19 | 19 | }); |
20 | 20 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | public function testResolveOptionsWithMissingAction() |
47 | 47 | { |
48 | 48 | $adminConfiguration = $this->createAdminConfigurationMock([ |
49 | - ['actions', [],], |
|
49 | + ['actions', [], ], |
|
50 | 50 | ]); |
51 | 51 | |
52 | 52 | $configuration = new ActionConfiguration('my_action', 'my_admin', $adminConfiguration); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | $this->assertEquals($admin, $helper->getCurrent()); |
22 | 22 | |
23 | - $this->assertExceptionRaised(Exception::class, function () use ($helper, $admin) { |
|
23 | + $this->assertExceptionRaised(Exception::class, function() use ($helper, $admin) { |
|
24 | 24 | $helper->setCurrent($admin); |
25 | 25 | }); |
26 | 26 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $metadata |
49 | 49 | ->expects($this->atLeastOnce()) |
50 | 50 | ->method('getFieldMapping') |
51 | - ->willReturnCallback(function (string $field) use ($fields) { |
|
51 | + ->willReturnCallback(function(string $field) use ($fields) { |
|
52 | 52 | $this->assertArrayHasKey($field, $fields); |
53 | 53 | |
54 | 54 | return [ |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $metadata |
60 | 60 | ->expects($this->atLeastOnce()) |
61 | 61 | ->method('getTypeOfField') |
62 | - ->willReturnCallback(function (string $field) use ($fields) { |
|
62 | + ->willReturnCallback(function(string $field) use ($fields) { |
|
63 | 63 | $this->assertArrayHasKey($field, $fields); |
64 | 64 | |
65 | 65 | return 'string'; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $metadataFactory |
100 | 100 | ->expects($this->once()) |
101 | 101 | ->method('getMetadataFor') |
102 | - ->willReturnCallback(function (string $class) { |
|
102 | + ->willReturnCallback(function(string $class) { |
|
103 | 103 | $this->assertEquals('MyLittleClass', $class); |
104 | 104 | |
105 | 105 | throw new Exception(); |