@@ -72,7 +72,7 @@ |
||
| 72 | 72 | |
| 73 | 73 | $this->assertExceptionRaised( |
| 74 | 74 | InvalidConfigurationException::class, |
| 75 | - function () use ($compilerPass, $containerBuilder) { |
|
| 75 | + function() use ($compilerPass, $containerBuilder) { |
|
| 76 | 76 | // process the compiler pass |
| 77 | 77 | $compilerPass->process($containerBuilder); |
| 78 | 78 | } |
@@ -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'; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | return $value; |
| 79 | 79 | }) |
| 80 | - ->setNormalizer('attr', function (Options $options, $value) { |
|
| 80 | + ->setNormalizer('attr', function(Options $options, $value) { |
|
| 81 | 81 | $position = $options->offsetGet('position'); |
| 82 | 82 | |
| 83 | 83 | if (!key_exists('class', $value)) { |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | return $value; |
| 102 | 102 | }) |
| 103 | - ->setNormalizer('item_css_class', function (Options $options, $value) { |
|
| 103 | + ->setNormalizer('item_css_class', function(Options $options, $value) { |
|
| 104 | 104 | $position = $options->offsetGet('position'); |
| 105 | 105 | |
| 106 | 106 | if (!$value) { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | return trim($value); |
| 119 | 119 | }) |
| 120 | - ->setNormalizer('brand', function (Options $options, $value) { |
|
| 120 | + ->setNormalizer('brand', function(Options $options, $value) { |
|
| 121 | 121 | if (null === $value && 'horizontal' === $options->offsetGet('position')) { |
| 122 | 122 | $value = $this->applicationName; |
| 123 | 123 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | ->setAllowedTypes('routing_name_pattern', 'string') |
| 87 | 87 | ->setAllowedTypes('routing_url_pattern', 'string') |
| 88 | 88 | ->setAllowedTypes('page_parameter', 'string') |
| 89 | - ->setNormalizer('routing_name_pattern', function (Options $options, $value) { |
|
| 89 | + ->setNormalizer('routing_name_pattern', function(Options $options, $value) { |
|
| 90 | 90 | if (false === strstr($value, '{admin}')) { |
| 91 | 91 | throw new InvalidOptionsException( |
| 92 | 92 | 'Admin routing configuration pattern name should contains the {admin} placeholder' |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | return $value; |
| 102 | 102 | }) |
| 103 | - ->setNormalizer('routing_url_pattern', function (Options $options, $value) { |
|
| 103 | + ->setNormalizer('routing_url_pattern', function(Options $options, $value) { |
|
| 104 | 104 | if (false === strstr($value, '{admin}')) { |
| 105 | 105 | throw new InvalidOptionsException('Admin routing configuration url pattern should contains {admin} placeholder'); |
| 106 | 106 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | 'pattern' => 'lag.admin.{key}', |
| 127 | 127 | ]); |
| 128 | 128 | $resolver->setAllowedTypes('translation', 'array'); |
| 129 | - $resolver->setNormalizer('translation', function (Options $options, $value) { |
|
| 129 | + $resolver->setNormalizer('translation', function(Options $options, $value) { |
|
| 130 | 130 | if (!array_key_exists('enabled', $value)) { |
| 131 | 131 | throw new InvalidOptionsException('Admin translation enabled parameter should be defined'); |
| 132 | 132 | } |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | $resolver->setDefault('fields_mapping', $defaultMapping); |
| 170 | 170 | $resolver->setAllowedTypes('fields_mapping', 'array'); |
| 171 | - $resolver->setNormalizer('fields_mapping', function (Options $options, $value) use ($defaultMapping) { |
|
| 171 | + $resolver->setNormalizer('fields_mapping', function(Options $options, $value) use ($defaultMapping) { |
|
| 172 | 172 | // Merge with default mapping to allow override |
| 173 | 173 | $value = array_merge($defaultMapping, $value); |
| 174 | 174 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $resolver->setDefault('fields_template_mapping', $defaultMapping); |
| 184 | 184 | $resolver->setAllowedTypes('fields_template_mapping', 'array'); |
| 185 | - $resolver->setNormalizer('fields_template_mapping', function (Options $options, $value) use ($defaultMapping) { |
|
| 185 | + $resolver->setNormalizer('fields_template_mapping', function(Options $options, $value) use ($defaultMapping) { |
|
| 186 | 186 | // Merge with default mapping to allow override |
| 187 | 187 | $value = array_merge($defaultMapping, $value); |
| 188 | 188 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | ->setDefault('items', []) |
| 56 | 56 | ->setDefault('icon', null) |
| 57 | 57 | ->setDefault('link_css_class', 'nav-link') |
| 58 | - ->setNormalizer('admin', function (Options $options, $adminName) { |
|
| 58 | + ->setNormalizer('admin', function(Options $options, $adminName) { |
|
| 59 | 59 | // user has to defined either an admin name and an action name, or a route name with optional |
| 60 | 60 | // parameters, or an url |
| 61 | 61 | if (null === $adminName |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | return $adminName; |
| 71 | 71 | }) |
| 72 | 72 | // if an admin name is set, an action name can provided. This action will be the menu link |
| 73 | - ->setNormalizer('action', function (Options $options, $action) { |
|
| 73 | + ->setNormalizer('action', function(Options $options, $action) { |
|
| 74 | 74 | // if an action name is provided, an admin name should be defined too |
| 75 | 75 | if (null !== $action && null === $options->offsetGet('admin')) { |
| 76 | 76 | throw new InvalidOptionsException( |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | return $action; |
| 87 | 87 | }) |
| 88 | 88 | ->setAllowedTypes('parameters', 'array') |
| 89 | - ->setNormalizer('attr', function (Options $options, $attr) { |
|
| 89 | + ->setNormalizer('attr', function(Options $options, $attr) { |
|
| 90 | 90 | if (!is_array($attr)) { |
| 91 | 91 | $attr = []; |
| 92 | 92 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | return $attr; |
| 103 | 103 | }) |
| 104 | - ->setNormalizer('link_attr', function (Options $options, $value) { |
|
| 104 | + ->setNormalizer('link_attr', function(Options $options, $value) { |
|
| 105 | 105 | if (!is_array($value)) { |
| 106 | 106 | $value = []; |
| 107 | 107 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | return $value; |
| 114 | 114 | }) |
| 115 | - ->setNormalizer('items', function (Options $options, $items) { |
|
| 115 | + ->setNormalizer('items', function(Options $options, $items) { |
|
| 116 | 116 | if (!is_array($items)) { |
| 117 | 117 | $items = []; |
| 118 | 118 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | return $resolvedItems; |
| 131 | 131 | }) |
| 132 | - ->setNormalizer('text', function (Options $options, $text) { |
|
| 132 | + ->setNormalizer('text', function(Options $options, $text) { |
|
| 133 | 133 | if (!$text) { |
| 134 | 134 | // TODO use translation pattern key instead |
| 135 | 135 | $text = ucfirst($this->name); |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | private function getFieldsNormalizer() |
| 160 | 160 | { |
| 161 | - return function (Options $options, $fields) { |
|
| 161 | + return function(Options $options, $fields) { |
|
| 162 | 162 | $normalizedFields = []; |
| 163 | 163 | |
| 164 | 164 | foreach ($fields as $name => $field) { |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | private function getOrderNormalizer() |
| 182 | 182 | { |
| 183 | - return function (Options $options, $order) { |
|
| 183 | + return function(Options $options, $order) { |
|
| 184 | 184 | foreach ($order as $field => $sort) { |
| 185 | 185 | if (!is_string($sort) || !is_string($field) || !in_array(strtolower($sort), ['asc', 'desc'])) { |
| 186 | 186 | throw new Exception( |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | */ |
| 204 | 204 | private function getLoadStrategyNormalizer() |
| 205 | 205 | { |
| 206 | - return function (Options $options, $value) { |
|
| 206 | + return function(Options $options, $value) { |
|
| 207 | 207 | if (!$value) { |
| 208 | 208 | if ('create' == $this->actionName) { |
| 209 | 209 | $value = LAGAdminBundle::LOAD_STRATEGY_NONE; |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | */ |
| 227 | 227 | private function getMenuNormalizer() |
| 228 | 228 | { |
| 229 | - return function (Options $options, $menus) { |
|
| 229 | + return function(Options $options, $menus) { |
|
| 230 | 230 | // set default to an array |
| 231 | 231 | if (false === $menus) { |
| 232 | 232 | $menus = []; |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | private function getCriteriaNormalizer() |
| 246 | 246 | { |
| 247 | - return function (Options $options, $value) { |
|
| 247 | + return function(Options $options, $value) { |
|
| 248 | 248 | if (!$value) { |
| 249 | 249 | $idActions = [ |
| 250 | 250 | 'edit', |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | */ |
| 294 | 294 | private function getFiltersNormalizer(): Closure |
| 295 | 295 | { |
| 296 | - return function (Options $options, $data) { |
|
| 296 | + return function(Options $options, $data) { |
|
| 297 | 297 | $normalizedData = []; |
| 298 | 298 | |
| 299 | 299 | foreach ($data as $name => $field) { |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | |
| 320 | 320 | private function getRouteDefaultNormalizer(): Closure |
| 321 | 321 | { |
| 322 | - return function (Options $options, $value) { |
|
| 322 | + return function(Options $options, $value) { |
|
| 323 | 323 | if (!is_array($value)) { |
| 324 | 324 | $value = []; |
| 325 | 325 | } |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | |
| 333 | 333 | private function getFormNormalizer(): Closure |
| 334 | 334 | { |
| 335 | - return function (Options $options, $value) { |
|
| 335 | + return function(Options $options, $value) { |
|
| 336 | 336 | if (null !== $value) { |
| 337 | 337 | return $value; |
| 338 | 338 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $eventDispatcher |
| 48 | 48 | ->expects($this->exactly(6)) |
| 49 | 49 | ->method('dispatch') |
| 50 | - ->willReturnCallback(function ($eventName, $event) use ($action, $form) { |
|
| 50 | + ->willReturnCallback(function($eventName, $event) use ($action, $form) { |
|
| 51 | 51 | if (Events::HANDLE_REQUEST === $eventName) { |
| 52 | 52 | /** @var AdminEvent $event */ |
| 53 | 53 | $this->assertInstanceOf(AdminEvent::class, $event); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | ); |
| 113 | 113 | $request = new Request(); |
| 114 | 114 | |
| 115 | - $this->assertExceptionRaised(Exception::class, function () use ($admin, $request) { |
|
| 115 | + $this->assertExceptionRaised(Exception::class, function() use ($admin, $request) { |
|
| 116 | 116 | $admin->handleRequest($request); |
| 117 | 117 | }); |
| 118 | 118 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $eventDispatcher |
| 128 | 128 | ->expects($this->once()) |
| 129 | 129 | ->method('dispatch') |
| 130 | - ->willReturnCallback(function ($eventName, $event) use ($view) { |
|
| 130 | + ->willReturnCallback(function($eventName, $event) use ($view) { |
|
| 131 | 131 | $this->assertEquals(Events::VIEW, $eventName); |
| 132 | 132 | /** @var ViewEvent $event */ |
| 133 | 133 | $this->assertInstanceOf(ViewEvent::class, $event); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $eventDispatcher |
| 179 | 179 | ->expects($this->exactly(5)) |
| 180 | 180 | ->method('dispatch') |
| 181 | - ->willReturnCallback(function ($eventName, $event) use ($action, $form) { |
|
| 181 | + ->willReturnCallback(function($eventName, $event) use ($action, $form) { |
|
| 182 | 182 | if (Events::HANDLE_REQUEST === $eventName) { |
| 183 | 183 | /** @var AdminEvent $event */ |
| 184 | 184 | $this->assertInstanceOf(AdminEvent::class, $event); |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | $eventDispatcher |
| 209 | 209 | ->expects($this->exactly(5)) |
| 210 | 210 | ->method('dispatch') |
| 211 | - ->willReturnCallback(function ($eventName, $event) use ($action, $form) { |
|
| 211 | + ->willReturnCallback(function($eventName, $event) use ($action, $form) { |
|
| 212 | 212 | if (Events::HANDLE_REQUEST === $eventName) { |
| 213 | 213 | /** @var AdminEvent $event */ |
| 214 | 214 | $this->assertInstanceOf(AdminEvent::class, $event); |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | public function testCreate() |
| 23 | 23 | { |
| 24 | - list($factory, , $requestStack,) = $this->createFactory(); |
|
| 24 | + list($factory,, $requestStack,) = $this->createFactory(); |
|
| 25 | 25 | |
| 26 | 26 | $requestStack |
| 27 | 27 | ->expects($this->atLeastOnce()) |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $admin = $this->createMock(AdminInterface::class); |
| 104 | 104 | $event = new AdminEvent($admin, $request); |
| 105 | 105 | |
| 106 | - $this->assertExceptionRaised(Exception::class, function () use ($subscriber, $event) { |
|
| 106 | + $this->assertExceptionRaised(Exception::class, function() use ($subscriber, $event) { |
|
| 107 | 107 | $subscriber->handleRequest($event); |
| 108 | 108 | }); |
| 109 | 109 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function testCreateView() |
| 115 | 115 | { |
| 116 | - list($subscriber, , $viewFactory) = $this->createSubscriber(); |
|
| 116 | + list($subscriber,, $viewFactory) = $this->createSubscriber(); |
|
| 117 | 117 | $view = $this->createMock(ViewInterface::class); |
| 118 | 118 | |
| 119 | 119 | $actionConfiguration = $this->createMock(ActionConfiguration::class); |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | */ |
| 252 | 252 | public function testLoadEntitiesWithMultipleStrategy() |
| 253 | 253 | { |
| 254 | - list($subscriber, , , $dataProviderFactory, , , ,) = $this->createSubscriber(); |
|
| 254 | + list($subscriber,,, $dataProviderFactory,,,,) = $this->createSubscriber(); |
|
| 255 | 255 | |
| 256 | 256 | $actionConfiguration = $this->createMock(ActionConfiguration::class); |
| 257 | 257 | $actionConfiguration |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | */ |
| 322 | 322 | public function testLoadEntitiesWithUniqueStrategy() |
| 323 | 323 | { |
| 324 | - list($subscriber, , , $dataProviderFactory) = $this->createSubscriber(); |
|
| 324 | + list($subscriber,,, $dataProviderFactory) = $this->createSubscriber(); |
|
| 325 | 325 | |
| 326 | 326 | $actionConfiguration = $this->createMock(ActionConfiguration::class); |
| 327 | 327 | $actionConfiguration |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | */ |
| 395 | 395 | public function testLoadEntitiesWithoutIdentifier() |
| 396 | 396 | { |
| 397 | - list($subscriber, , , $dataProviderFactory) = $this->createSubscriber(); |
|
| 397 | + list($subscriber,,, $dataProviderFactory) = $this->createSubscriber(); |
|
| 398 | 398 | |
| 399 | 399 | $actionConfiguration = $this->createMock(ActionConfiguration::class); |
| 400 | 400 | $actionConfiguration |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | $request = new Request(); |
| 452 | 452 | $event = new EntityEvent($admin, $request); |
| 453 | 453 | |
| 454 | - $this->assertExceptionRaised(Exception::class, function () use ($subscriber, $event) { |
|
| 454 | + $this->assertExceptionRaised(Exception::class, function() use ($subscriber, $event) { |
|
| 455 | 455 | $subscriber->loadEntities($event); |
| 456 | 456 | }); |
| 457 | 457 | } |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | */ |
| 462 | 462 | public function testSaveEntity() |
| 463 | 463 | { |
| 464 | - list($subscriber, , , $dataProviderFactory, , $session, $translator) = $this->createSubscriber(); |
|
| 464 | + list($subscriber,,, $dataProviderFactory,, $session, $translator) = $this->createSubscriber(); |
|
| 465 | 465 | |
| 466 | 466 | $adminConfiguration = $this->createMock(AdminConfiguration::class); |
| 467 | 467 | $adminConfiguration |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | |
| 70 | 70 | public function testBuildMenuWithoutConfiguration() |
| 71 | 71 | { |
| 72 | - list($subscriber, , $menuFactory, $eventDispatcher) = $this->createSubscriber(); |
|
| 72 | + list($subscriber,, $menuFactory, $eventDispatcher) = $this->createSubscriber(); |
|
| 73 | 73 | $event = new MenuEvent(); |
| 74 | 74 | |
| 75 | 75 | $menuFactory |