@@ -36,6 +36,6 @@ |
||
36 | 36 | $value = $this->translator->trans($value); |
37 | 37 | } |
38 | 38 | |
39 | - return (string)$value; |
|
39 | + return (string) $value; |
|
40 | 40 | } |
41 | 41 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | 'template' => '@LAGAdmin/Field/actionCollection.html.twig', |
40 | 40 | 'actions' => [], |
41 | 41 | ]) |
42 | - ->setNormalizer('actions', function (Options $options, $value) use ($actionConfiguration, $defaultActions) { |
|
42 | + ->setNormalizer('actions', function(Options $options, $value) use ($actionConfiguration, $defaultActions) { |
|
43 | 43 | if (!is_array($value) || 0 === count($value)) { |
44 | 44 | $value = [ |
45 | 45 | 'edit' => [], |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | '_self', |
139 | 139 | '_blank', |
140 | 140 | ]) |
141 | - ->setNormalizer('route', function (Options $options, $value) use ($actionConfiguration) { |
|
141 | + ->setNormalizer('route', function(Options $options, $value) use ($actionConfiguration) { |
|
142 | 142 | // route or url should be defined |
143 | 143 | if (!$value && !$options->offsetGet('url') && !$options->offsetGet('admin')) { |
144 | 144 | throw new InvalidOptionsException( |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | return $value; |
158 | 158 | }) |
159 | - ->setNormalizer('admin', function (Options $options, $value) { |
|
159 | + ->setNormalizer('admin', function(Options $options, $value) { |
|
160 | 160 | // if a Admin is defined, an Action should be defined too |
161 | 161 | if ($value && !$options->offsetGet('action')) { |
162 | 162 | throw new InvalidOptionsException( |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | return $value; |
168 | 168 | }) |
169 | - ->setNormalizer('parameters', function (Options $options, $values) { |
|
169 | + ->setNormalizer('parameters', function(Options $options, $values) { |
|
170 | 170 | $cleanedValues = []; |
171 | 171 | |
172 | 172 | foreach ($values as $name => $method) { |
@@ -32,7 +32,7 @@ |
||
32 | 32 | public function __construct( |
33 | 33 | RequestStack $requestStack, |
34 | 34 | ApplicationConfigurationStorage $applicationConfigurationStorage |
35 | - ){ |
|
35 | + ) { |
|
36 | 36 | $this->requestStack = $requestStack; |
37 | 37 | $this->applicationConfiguration = $applicationConfigurationStorage->getConfiguration(); |
38 | 38 | } |
@@ -138,6 +138,10 @@ discard block |
||
138 | 138 | ]; |
139 | 139 | } |
140 | 140 | |
141 | + /** |
|
142 | + * @param string $entityClass |
|
143 | + * @param string $adminName |
|
144 | + */ |
|
141 | 145 | private function addDefaultFields(array &$configuration, $entityClass, $adminName) |
142 | 146 | { |
143 | 147 | $fieldsMapping = [ |
@@ -343,7 +347,7 @@ discard block |
||
343 | 347 | /** |
344 | 348 | * Return the default action field if found. |
345 | 349 | * |
346 | - * @param array $fields |
|
350 | + * @param string[] $fields |
|
347 | 351 | * |
348 | 352 | * @return string|null |
349 | 353 | */ |
@@ -420,6 +424,9 @@ discard block |
||
420 | 424 | return $metadata; |
421 | 425 | } |
422 | 426 | |
427 | + /** |
|
428 | + * @param string $type |
|
429 | + */ |
|
423 | 430 | private function getOperatorFromFieldType($type) |
424 | 431 | { |
425 | 432 | $mapping = [ |
@@ -172,7 +172,7 @@ |
||
172 | 172 | /** |
173 | 173 | * @param array $configuration |
174 | 174 | * @param ActionConfiguration $actionConfiguration |
175 | - * @return array |
|
175 | + * @return string |
|
176 | 176 | * @throws Exception |
177 | 177 | */ |
178 | 178 | private function resolveTopLevelConfiguration(array $configuration, ActionConfiguration $actionConfiguration) |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $eventDispatcher |
90 | 90 | ->expects($this->once()) |
91 | 91 | ->method('dispatch') |
92 | - ->willReturnCallback(function ($eventName, $event) use ($queryBuilder, $admin) { |
|
92 | + ->willReturnCallback(function($eventName, $event) use ($queryBuilder, $admin) { |
|
93 | 93 | $this->assertEquals(AdminEvents::DOCTRINE_ORM_FILTER, $eventName); |
94 | 94 | /** @var DoctrineOrmFilterEvent $event */ |
95 | 95 | $this->assertInstanceOf(DoctrineOrmFilterEvent::class, $event); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $requestStack |
218 | 218 | ); |
219 | 219 | |
220 | - $this->assertExceptionRaised(Exception::class, function () use ($provider, $admin) { |
|
220 | + $this->assertExceptionRaised(Exception::class, function() use ($provider, $admin) { |
|
221 | 221 | $provider->get($admin, 42); |
222 | 222 | }); |
223 | 223 | } |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | /** @var RequestStack|MockObject $requestStack */ |
231 | 231 | $requestStack = $this->createMock(RequestStack::class); |
232 | 232 | |
233 | - $entity =new EntityFixture(42); |
|
233 | + $entity = new EntityFixture(42); |
|
234 | 234 | |
235 | 235 | /** @var EntityManagerInterface|MockObject $entityManager */ |
236 | 236 | $entityManager = $this->createMock(EntityManagerInterface::class); |