@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | 'custom_buttons' => [], |
| 29 | 29 | ]) |
| 30 | 30 | ->setAllowedTypes('tinymce_options', 'array') |
| 31 | - ->addNormalizer('tinymce_options', function (Options $options, $value) { |
|
| 31 | + ->addNormalizer('tinymce_options', function(Options $options, $value) { |
|
| 32 | 32 | $attr = $options->offsetGet('attr'); |
| 33 | 33 | |
| 34 | 34 | if (\array_key_exists('id', $attr)) { |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | return array_replace_recursive($this->getTinyMceDefaultConfiguration(), $value); |
| 42 | 42 | }) |
| 43 | 43 | ->setAllowedTypes('custom_buttons', 'array') |
| 44 | - ->addNormalizer('custom_buttons', function (Options $options, $value) { |
|
| 44 | + ->addNormalizer('custom_buttons', function(Options $options, $value) { |
|
| 45 | 45 | foreach ($value as $item => $button) { |
| 46 | 46 | $buttonResolver = new OptionsResolver(); |
| 47 | 47 | $buttonResolver->setDefaults([ |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | $mappedRouteParameters = []; |
| 13 | 13 | |
| 14 | 14 | foreach ($routeParameters as $parameter => $requirements) { |
| 15 | - $mappedRouteParameters[$parameter] = $accessor->getValue($data, (string)$parameter); |
|
| 15 | + $mappedRouteParameters[$parameter] = $accessor->getValue($data, (string) $parameter); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | return $mappedRouteParameters; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | ->setAllowedTypes('name', 'string') |
| 31 | 31 | ->setDefault('title', null) |
| 32 | 32 | ->setAllowedTypes('title', ['string', 'null']) |
| 33 | - ->addNormalizer('title', function (Options $options, $value) { |
|
| 33 | + ->addNormalizer('title', function(Options $options, $value) { |
|
| 34 | 34 | if ($value === null) { |
| 35 | 35 | $value = u($options->offsetGet('name'))->title()->toString(); |
| 36 | 36 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | 'delete' => [], |
| 53 | 53 | ]) |
| 54 | 54 | ->setAllowedTypes('list_actions', 'array') |
| 55 | - ->setNormalizer('list_actions', function (Options $options, $value) { |
|
| 55 | + ->setNormalizer('list_actions', function(Options $options, $value) { |
|
| 56 | 56 | foreach ($value as $actionName => $actionConfiguration) { |
| 57 | 57 | $value[$actionName] = LinkNormalizer::normalize( |
| 58 | 58 | $actionConfiguration, |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | 'create' => [], |
| 69 | 69 | ]) |
| 70 | 70 | ->setAllowedTypes('item_actions', 'array') |
| 71 | - ->setNormalizer('item_actions', function (Options $options, $value) { |
|
| 71 | + ->setNormalizer('item_actions', function(Options $options, $value) { |
|
| 72 | 72 | foreach ($value as $actionName => $actionConfiguration) { |
| 73 | 73 | $value[$actionName] = LinkNormalizer::normalize( |
| 74 | 74 | $actionConfiguration, |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | |
| 275 | 275 | private function getActionNormalizer(): Closure |
| 276 | 276 | { |
| 277 | - return function (Options $options, $actions) { |
|
| 277 | + return function(Options $options, $actions) { |
|
| 278 | 278 | $normalizedActions = []; |
| 279 | 279 | // $addBatchAction = false; |
| 280 | 280 | |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | private function getRoutesPatternNormalizer(): Closure |
| 312 | 312 | { |
| 313 | - return function (Options $options, $value) { |
|
| 313 | + return function(Options $options, $value) { |
|
| 314 | 314 | if (!u($value)->containsAny('{action}')) { |
| 315 | 315 | throw new InvalidOptionsException(sprintf('The "%s" parameters in admin "%s" should contains the "%s" parameters', 'routes_pattern', $options->offsetGet('name'), '{action}')); |
| 316 | 316 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | 'delete' => [], |
| 46 | 46 | ]) |
| 47 | 47 | ->setAllowedTypes('list_actions', 'array') |
| 48 | - ->setNormalizer('list_actions', function (Options $options, $value) { |
|
| 48 | + ->setNormalizer('list_actions', function(Options $options, $value) { |
|
| 49 | 49 | foreach ($value as $actionName => $actionConfiguration) { |
| 50 | 50 | $value[$actionName] = LinkNormalizer::normalize( |
| 51 | 51 | $actionConfiguration, |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | 'create' => [], |
| 62 | 62 | ]) |
| 63 | 63 | ->setAllowedTypes('item_actions', 'array') |
| 64 | - ->setNormalizer('item_actions', function (Options $options, $value) { |
|
| 64 | + ->setNormalizer('item_actions', function(Options $options, $value) { |
|
| 65 | 65 | foreach ($value as $actionName => $actionConfiguration) { |
| 66 | 66 | $value[$actionName] = LinkNormalizer::normalize( |
| 67 | 67 | $actionConfiguration, |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | private function getTitleNormalizer(): Closure |
| 309 | 309 | { |
| 310 | - return function (Options $options, $value) { |
|
| 310 | + return function(Options $options, $value) { |
|
| 311 | 311 | if ($value === null) { |
| 312 | 312 | $value = u($options->offsetGet('name'))->camel()->title()->toString(); |
| 313 | 313 | } |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | |
| 319 | 319 | private function getTemplateNormalizer(): Closure |
| 320 | 320 | { |
| 321 | - return function (Options $options, $value) { |
|
| 321 | + return function(Options $options, $value) { |
|
| 322 | 322 | $map = [ |
| 323 | 323 | 'create' => '@LAGAdmin/crud/create.html.twig', |
| 324 | 324 | 'edit' => '@LAGAdmin/crud/edit.html.twig', |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | |
| 340 | 340 | private function getPathNormalizer(): Closure |
| 341 | 341 | { |
| 342 | - return function (Options $options, $value) { |
|
| 342 | + return function(Options $options, $value) { |
|
| 343 | 343 | if ($value !== null) { |
| 344 | 344 | $path = u($value); |
| 345 | 345 | |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | */ |
| 399 | 399 | private function getFieldsNormalizer(): Closure |
| 400 | 400 | { |
| 401 | - return function (Options $options, $fields) { |
|
| 401 | + return function(Options $options, $fields) { |
|
| 402 | 402 | $normalizedFields = []; |
| 403 | 403 | |
| 404 | 404 | foreach ($fields as $name => $field) { |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | */ |
| 419 | 419 | private function getOrderNormalizer(): Closure |
| 420 | 420 | { |
| 421 | - return function (Options $options, $order) { |
|
| 421 | + return function(Options $options, $order) { |
|
| 422 | 422 | foreach ($order as $field => $sort) { |
| 423 | 423 | if (!\is_string($sort) || !\is_string($field) || !\in_array(strtolower($sort), ['asc', 'desc'])) { |
| 424 | 424 | throw new Exception('Order value should be an array of string (["field" => $key]), got '.\gettype($sort)); |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | |
| 432 | 432 | private function getLoadStrategyNormalizer(): Closure |
| 433 | 433 | { |
| 434 | - return function (Options $options, $value) { |
|
| 434 | + return function(Options $options, $value) { |
|
| 435 | 435 | if ($value !== null) { |
| 436 | 436 | return $value; |
| 437 | 437 | } |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | */ |
| 455 | 455 | private function getCriteriaNormalizer(): Closure |
| 456 | 456 | { |
| 457 | - return function (Options $options, $value) { |
|
| 457 | + return function(Options $options, $value) { |
|
| 458 | 458 | if (!$value) { |
| 459 | 459 | $idActions = [ |
| 460 | 460 | 'edit', |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | */ |
| 478 | 478 | private function getFiltersNormalizer(): Closure |
| 479 | 479 | { |
| 480 | - return function (Options $options, $data) { |
|
| 480 | + return function(Options $options, $data) { |
|
| 481 | 481 | $normalizedData = []; |
| 482 | 482 | |
| 483 | 483 | foreach ($data as $name => $field) { |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | |
| 504 | 504 | private function getRouteParametersNormalizer(): Closure |
| 505 | 505 | { |
| 506 | - return function (Options $options, $value) { |
|
| 506 | + return function(Options $options, $value) { |
|
| 507 | 507 | if (\count($value) > 0) { |
| 508 | 508 | return $value; |
| 509 | 509 | } |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | |
| 519 | 519 | private function getLinkedActionsNormalizer(): Closure |
| 520 | 520 | { |
| 521 | - return function (Options $options, $value) { |
|
| 521 | + return function(Options $options, $value) { |
|
| 522 | 522 | $actions = array_keys($options->offsetGet('actions')); |
| 523 | 523 | |
| 524 | 524 | foreach ($value as $actionName) { |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | ) { |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - public function getTranslationKey(string $key , string $adminName = 'ui'): string |
|
| 20 | + public function getTranslationKey(string $key, string $adminName = 'ui'): string |
|
| 21 | 21 | { |
| 22 | 22 | $translationPattern = $this->applicationConfiguration->getTranslationPattern(); |
| 23 | 23 | $translationPattern = str_replace('{key}', $key, $translationPattern); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | 'title' => null, |
| 37 | 37 | 'url' => '', |
| 38 | 38 | ]) |
| 39 | - ->setNormalizer('route', function (Options $options, $value) use ($applicationConfiguration) { |
|
| 39 | + ->setNormalizer('route', function(Options $options, $value) use ($applicationConfiguration) { |
|
| 40 | 40 | // A route, an url or an admin should be defined |
| 41 | 41 | if (!$value && !$options->offsetGet('url') && !$options->offsetGet('admin')) { |
| 42 | 42 | throw new InvalidOptionsException('Either an url or a route should be defined'); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | return $value; |
| 50 | 50 | }) |
| 51 | - ->setNormalizer('admin', function (Options $options, $value) { |
|
| 51 | + ->setNormalizer('admin', function(Options $options, $value) { |
|
| 52 | 52 | // if a Admin is defined, an Action should be defined too |
| 53 | 53 | if ($value && !$options->offsetGet('action')) { |
| 54 | 54 | throw new InvalidOptionsException('An Action should be provided if an Admin is provided'); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | return $value; |
| 58 | 58 | }) |
| 59 | - ->setNormalizer('text', function (Options $options, $value) { |
|
| 59 | + ->setNormalizer('text', function(Options $options, $value) { |
|
| 60 | 60 | if ($value) { |
| 61 | 61 | return $value; |
| 62 | 62 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | 'translation' => true, |
| 26 | 26 | 'property_path' => null, |
| 27 | 27 | ]) |
| 28 | - ->addNormalizer('attr', function (Options $options, $value) { |
|
| 28 | + ->addNormalizer('attr', function(Options $options, $value) { |
|
| 29 | 29 | if (!empty($value['class'])) { |
| 30 | 30 | return $value; |
| 31 | 31 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | { |
| 14 | 14 | $helper = new AdminContext(); |
| 15 | 15 | |
| 16 | - $this->assertExceptionRaised(Exception::class, function () use ($helper) { |
|
| 16 | + $this->assertExceptionRaised(Exception::class, function() use ($helper) { |
|
| 17 | 17 | $helper->getAdmin(); |
| 18 | 18 | }); |
| 19 | 19 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | $this->assertEquals($admin, $helper->getAdmin()); |
| 24 | 24 | |
| 25 | - $this->assertExceptionRaised(Exception::class, function () use ($helper, $admin) { |
|
| 25 | + $this->assertExceptionRaised(Exception::class, function() use ($helper, $admin) { |
|
| 26 | 26 | $helper->setAdmin($admin); |
| 27 | 27 | }); |
| 28 | 28 | } |