@@ -40,14 +40,14 @@ discard block |
||
40 | 40 | ->setAllowedTypes('allow_add', 'boolean') |
41 | 41 | ->setAllowedTypes('create_property_path', ['string', 'null']) |
42 | 42 | ->setAllowedTypes('select2_options', 'array') |
43 | - ->setNormalizer('create_property_path', function (Options $options, $value) { |
|
43 | + ->setNormalizer('create_property_path', function(Options $options, $value) { |
|
44 | 44 | if ($options->offsetGet('allow_add') && !$value) { |
45 | 45 | throw new InvalidOptionsException('The options "create_property_path" should be defined when "allow_add" is set to true'); |
46 | 46 | } |
47 | 47 | |
48 | 48 | return $value; |
49 | 49 | }) |
50 | - ->setNormalizer('select2_options', function (Options $options, $value) { |
|
50 | + ->setNormalizer('select2_options', function(Options $options, $value) { |
|
51 | 51 | if ($options->offsetGet('allow_add')) { |
52 | 52 | $value['tags'] = json_encode(true); |
53 | 53 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public function buildForm(FormBuilderInterface $builder, array $options) |
61 | 61 | { |
62 | 62 | $builder |
63 | - ->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($options) { |
|
63 | + ->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($options) { |
|
64 | 64 | $manager = $this->registry->getManagerForClass($options['class']); |
65 | 65 | $repository = $manager->getRepository($options['class']); |
66 | 66 | $propertyAccessor = PropertyAccess::createPropertyAccessor(); |
@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | public function getDataTransformer(): ?Closure |
20 | 20 | { |
21 | - return function ($data) { |
|
21 | + return function($data) { |
|
22 | 22 | return is_countable($data) ? \count($data) : 0; |
23 | 23 | }; |
24 | 24 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | public function getDataTransformer(): ?Closure |
24 | 24 | { |
25 | - return function ($data) { |
|
25 | + return function($data) { |
|
26 | 26 | if ($data === null) { |
27 | 27 | return ''; |
28 | 28 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | 'options' => [], |
17 | 17 | ]) |
18 | 18 | ->setAllowedTypes('type', ['string', 'null']) |
19 | - ->setNormalizer('type', function (Options $options, $value) { |
|
19 | + ->setNormalizer('type', function(Options $options, $value) { |
|
20 | 20 | if ($value === null) { |
21 | 21 | $value = 'auto'; |
22 | 22 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | }) |
26 | 26 | |
27 | 27 | ->setAllowedTypes('options', ['array', 'null']) |
28 | - ->setNormalizer('options', function (Options $options, $values) { |
|
28 | + ->setNormalizer('options', function(Options $options, $values) { |
|
29 | 29 | if ($values === null) { |
30 | 30 | return []; |
31 | 31 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | public function getDataTransformer(): ?Closure |
24 | 24 | { |
25 | - return function ($data) { |
|
25 | + return function($data) { |
|
26 | 26 | if ($data === null) { |
27 | 27 | return ''; |
28 | 28 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | ->setAllowedTypes('translation', ['boolean']) |
50 | 50 | ->setAllowedTypes('translation_domain', ['string', 'null']) |
51 | 51 | ->setAllowedTypes('sortable', ['boolean']) |
52 | - ->addNormalizer('attr', function (Options $options, $value) { |
|
52 | + ->addNormalizer('attr', function(Options $options, $value) { |
|
53 | 53 | if ($value === null) { |
54 | 54 | $value = []; |
55 | 55 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | return $value; |
64 | 64 | }) |
65 | - ->addNormalizer('header_attr', function (Options $options, $value) { |
|
65 | + ->addNormalizer('header_attr', function(Options $options, $value) { |
|
66 | 66 | if ($value === null) { |
67 | 67 | $value = []; |
68 | 68 | } |
@@ -75,14 +75,14 @@ discard block |
||
75 | 75 | |
76 | 76 | return $value; |
77 | 77 | }) |
78 | - ->setNormalizer('mapped', function (Options $options, $mapped) { |
|
78 | + ->setNormalizer('mapped', function(Options $options, $mapped) { |
|
79 | 79 | if (u($this->getName())->startsWith('_')) { |
80 | 80 | return true; |
81 | 81 | } |
82 | 82 | |
83 | 83 | return $mapped; |
84 | 84 | }) |
85 | - ->setNormalizer('property_path', function (Options $options, $propertyPath) { |
|
85 | + ->setNormalizer('property_path', function(Options $options, $propertyPath) { |
|
86 | 86 | if (u($this->getName())->startsWith('_')) { |
87 | 87 | return null; |
88 | 88 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $field |
40 | 40 | ->expects($this->once()) |
41 | 41 | ->method('getDataTransformer') |
42 | - ->willReturn(function ($value) { |
|
42 | + ->willReturn(function($value) { |
|
43 | 43 | return u($value)->title()->toString(); |
44 | 44 | }) |
45 | 45 | ; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | ->environment |
63 | 63 | ->expects($this->once()) |
64 | 64 | ->method('render') |
65 | - ->willReturnCallback(function ($template, $context) use($data) { |
|
65 | + ->willReturnCallback(function($template, $context) use($data) { |
|
66 | 66 | $this->assertEquals('@LAGAdmin/fields/string.html.twig', $template); |
67 | 67 | $this->assertEquals([ |
68 | 68 | 'data' => 'My_value', |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $field |
94 | 94 | ->expects($this->once()) |
95 | 95 | ->method('getDataTransformer') |
96 | - ->willReturn(function ($value) { |
|
96 | + ->willReturn(function($value) { |
|
97 | 97 | return u($value)->title()->toString(); |
98 | 98 | }) |
99 | 99 | ; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | ->environment |
114 | 114 | ->expects($this->once()) |
115 | 115 | ->method('render') |
116 | - ->willReturnCallback(function () { |
|
116 | + ->willReturnCallback(function() { |
|
117 | 117 | throw new Exception(); |
118 | 118 | }) |
119 | 119 | ; |
@@ -19,7 +19,7 @@ |
||
19 | 19 | $metadataFactory |
20 | 20 | ->expects($this->once()) |
21 | 21 | ->method('getMetadataFor') |
22 | - ->willReturnCallback(function (string $class) { |
|
22 | + ->willReturnCallback(function(string $class) { |
|
23 | 23 | $this->assertEquals('MyLittleClass', $class); |
24 | 24 | |
25 | 25 | throw new Exception(); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | public function testInvokeWithStrategyUnique(): void |
57 | 57 | { |
58 | - [$event,$admin,,$adminConfiguration,$actionConfiguration,$request] = $this->createDataEvent(); |
|
58 | + [$event, $admin,,$adminConfiguration, $actionConfiguration, $request] = $this->createDataEvent(); |
|
59 | 59 | $request->query->set('id', 666); |
60 | 60 | |
61 | 61 | $dataProvider = $this->createMock(AdminAwareDataProviderInterface::class); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | public function testInvokeWithStrategyUniqueWithoutIdentifier(): void |
110 | 110 | { |
111 | - [$event,$admin,$action,$adminConfiguration,$actionConfiguration,] = $this->createDataEvent(); |
|
111 | + [$event, $admin, $action, $adminConfiguration, $actionConfiguration, ] = $this->createDataEvent(); |
|
112 | 112 | |
113 | 113 | $dataProvider = $this->createMock(AdminAwareDataProviderInterface::class); |
114 | 114 | $admin |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | public function testInvokeWithStrategyMultiple(): void |
166 | 166 | { |
167 | - [$event,$admin,$action,$adminConfiguration,$actionConfiguration,] = $this->createDataEvent(); |
|
167 | + [$event, $admin, $action, $adminConfiguration, $actionConfiguration, ] = $this->createDataEvent(); |
|
168 | 168 | |
169 | 169 | $dataProvider = $this->createMock(AdminAwareDataProviderInterface::class); |
170 | 170 |