@@ -17,7 +17,7 @@ |
||
| 17 | 17 | $builder |
| 18 | 18 | ->expects($this->atLeastOnce()) |
| 19 | 19 | ->method('setParameter') |
| 20 | - ->willReturnCallback(function ($parameter, $value) { |
|
| 20 | + ->willReturnCallback(function($parameter, $value) { |
|
| 21 | 21 | $this->assertContains($parameter, [ |
| 22 | 22 | 'lag.admin.enable_extra_configuration', |
| 23 | 23 | 'lag.admin.application_configuration', |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | |
| 120 | 120 | return $resolvedItems; |
| 121 | 121 | }) |
| 122 | - ->setNormalizer('text', function (Options $options, $text) { |
|
| 122 | + ->setNormalizer('text', function(Options $options, $text) { |
|
| 123 | 123 | if (!$text) { |
| 124 | 124 | // TODO use translation pattern key instead |
| 125 | 125 | $text = ucfirst($this->name); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | 'vertical', |
| 54 | 54 | null |
| 55 | 55 | ]) |
| 56 | - ->setNormalizer('position', function (Options $options, $value) { |
|
| 56 | + ->setNormalizer('position', function(Options $options, $value) { |
|
| 57 | 57 | if ('top' === $this->menuName && null === $value) { |
| 58 | 58 | $value = 'horizontal'; |
| 59 | 59 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | return $value; |
| 66 | 66 | }) |
| 67 | - ->setNormalizer('template', function (Options $options, $value) { |
|
| 67 | + ->setNormalizer('template', function(Options $options, $value) { |
|
| 68 | 68 | // Define bootstrap navbar component template |
| 69 | 69 | if ('horizontal' === $options->offsetGet('position')) { |
| 70 | 70 | $value = '@LAGAdmin/Menu/menu.horizontal.html.twig'; |
@@ -73,12 +73,12 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | // Define bootstrap nav component template |
| 75 | 75 | if ('vertical' === $options->offsetGet('position')) { |
| 76 | - $value ='@LAGAdmin/Menu/menu.vertical.html.twig'; |
|
| 76 | + $value = '@LAGAdmin/Menu/menu.vertical.html.twig'; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | return $value; |
| 80 | 80 | }) |
| 81 | - ->setNormalizer('attr', function (Options $options, $value) { |
|
| 81 | + ->setNormalizer('attr', function(Options $options, $value) { |
|
| 82 | 82 | $position = $options->offsetGet('position'); |
| 83 | 83 | |
| 84 | 84 | if (!key_exists('class', $value)) { |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | return $value; |
| 98 | 98 | }) |
| 99 | - ->setNormalizer('item_css_class', function (Options $options, $value) { |
|
| 99 | + ->setNormalizer('item_css_class', function(Options $options, $value) { |
|
| 100 | 100 | $position = $options->offsetGet('position'); |
| 101 | 101 | |
| 102 | 102 | if (!$value) { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | return trim($value); |
| 115 | 115 | }) |
| 116 | - ->setNormalizer('brand', function (Options $options, $value) { |
|
| 116 | + ->setNormalizer('brand', function(Options $options, $value) { |
|
| 117 | 117 | if (null === $value && 'horizontal' === $options->offsetGet('position')) { |
| 118 | 118 | $value = $this->applicationName; |
| 119 | 119 | } |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if ($this->applicationConfiguration->getParameter('enable_homepage')) { |
| 135 | - $route = new Route('/', ['_controller' => HomeAction::class,], []); |
|
| 135 | + $route = new Route('/', ['_controller' => HomeAction::class, ], []); |
|
| 136 | 136 | $routes->add('lag.admin.homepage', $route); |
| 137 | 137 | } |
| 138 | 138 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | */ |
| 165 | 165 | private function getFieldsNormalizer() |
| 166 | 166 | { |
| 167 | - return function (Options $options, $fields) { |
|
| 167 | + return function(Options $options, $fields) { |
|
| 168 | 168 | $normalizedFields = []; |
| 169 | 169 | |
| 170 | 170 | foreach ($fields as $name => $field) { |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | private function getOrderNormalizer() |
| 189 | 189 | { |
| 190 | - return function (Options $options, $order) { |
|
| 190 | + return function(Options $options, $order) { |
|
| 191 | 191 | foreach ($order as $field => $sort) { |
| 192 | 192 | |
| 193 | 193 | if (!is_string($sort) || !is_string($field) || !in_array(strtolower($sort), ['asc', 'desc'])) { |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | private function getLoadStrategyNormalizer() |
| 213 | 213 | { |
| 214 | - return function (Options $options, $value) { |
|
| 214 | + return function(Options $options, $value) { |
|
| 215 | 215 | if (!$value) { |
| 216 | 216 | if ($this->actionName == 'create') { |
| 217 | 217 | $value = LAGAdminBundle::LOAD_STRATEGY_NONE; |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | */ |
| 235 | 235 | private function getMenuNormalizer() |
| 236 | 236 | { |
| 237 | - return function (Options $options, $menus) { |
|
| 237 | + return function(Options $options, $menus) { |
|
| 238 | 238 | // set default to an array |
| 239 | 239 | if ($menus === false) { |
| 240 | 240 | $menus = []; |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | private function getCriteriaNormalizer() |
| 254 | 254 | { |
| 255 | - return function (Options $options, $value) { |
|
| 255 | + return function(Options $options, $value) { |
|
| 256 | 256 | if (!$value) { |
| 257 | 257 | $idActions = [ |
| 258 | 258 | 'edit', |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | */ |
| 302 | 302 | private function getFiltersNormalizer() |
| 303 | 303 | { |
| 304 | - return function (Options $options, $data) { |
|
| 304 | + return function(Options $options, $data) { |
|
| 305 | 305 | $normalizedData = []; |
| 306 | 306 | |
| 307 | 307 | foreach ($data as $name => $field) { |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | |
| 328 | 328 | private function getRouteDefaultNormalizer() |
| 329 | 329 | { |
| 330 | - return function (Options $options, $value) { |
|
| 330 | + return function(Options $options, $value) { |
|
| 331 | 331 | if (!is_array($value)) { |
| 332 | 332 | $value = []; |
| 333 | 333 | } |
@@ -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 | } |
@@ -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->getItem($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); |