@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | ->setDefault('items', []) |
| 57 | 57 | ->setDefault('icon', null) |
| 58 | 58 | ->setDefault('link_css_class', 'nav-link') |
| 59 | - ->setNormalizer('admin', function (Options $options, $adminName) { |
|
| 59 | + ->setNormalizer('admin', function(Options $options, $adminName) { |
|
| 60 | 60 | // user has to defined either an admin name and an action name, or a route name with optional |
| 61 | 61 | // parameters, or an url |
| 62 | 62 | if (null === $adminName |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | return $adminName; |
| 72 | 72 | }) |
| 73 | 73 | // if an admin name is set, an action name can provided. This action will be the menu link |
| 74 | - ->setNormalizer('action', function (Options $options, $action) { |
|
| 74 | + ->setNormalizer('action', function(Options $options, $action) { |
|
| 75 | 75 | // if an action name is provided, an admin name should be defined too |
| 76 | 76 | if (null !== $action && null === $options->offsetGet('admin')) { |
| 77 | 77 | throw new InvalidOptionsException( |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | return $action; |
| 88 | 88 | }) |
| 89 | 89 | ->setAllowedTypes('parameters', 'array') |
| 90 | - ->setNormalizer('attr', function (Options $options, $attr) { |
|
| 90 | + ->setNormalizer('attr', function(Options $options, $attr) { |
|
| 91 | 91 | if (!is_array($attr)) { |
| 92 | 92 | $attr = []; |
| 93 | 93 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | return $attr; |
| 104 | 104 | }) |
| 105 | - ->setNormalizer('link_attr', function (Options $options, $value) { |
|
| 105 | + ->setNormalizer('link_attr', function(Options $options, $value) { |
|
| 106 | 106 | if (!is_array($value)) { |
| 107 | 107 | $value = []; |
| 108 | 108 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | return $value; |
| 115 | 115 | }) |
| 116 | - ->setNormalizer('items', function (Options $options, $items) { |
|
| 116 | + ->setNormalizer('items', function(Options $options, $items) { |
|
| 117 | 117 | if (!is_array($items)) { |
| 118 | 118 | $items = []; |
| 119 | 119 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | return $resolvedItems; |
| 132 | 132 | }) |
| 133 | - ->setNormalizer('text', function (Options $options, $text) { |
|
| 133 | + ->setNormalizer('text', function(Options $options, $text) { |
|
| 134 | 134 | if ($text) { |
| 135 | 135 | return $text; |
| 136 | 136 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | private function getFieldsNormalizer() |
| 164 | 164 | { |
| 165 | - return function (Options $options, $fields) { |
|
| 165 | + return function(Options $options, $fields) { |
|
| 166 | 166 | $normalizedFields = []; |
| 167 | 167 | |
| 168 | 168 | foreach ($fields as $name => $field) { |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | private function getOrderNormalizer() |
| 186 | 186 | { |
| 187 | - return function (Options $options, $order) { |
|
| 187 | + return function(Options $options, $order) { |
|
| 188 | 188 | foreach ($order as $field => $sort) { |
| 189 | 189 | if (!is_string($sort) || !is_string($field) || !in_array(strtolower($sort), ['asc', 'desc'])) { |
| 190 | 190 | throw new Exception( |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | */ |
| 206 | 206 | private function getLoadStrategyNormalizer() |
| 207 | 207 | { |
| 208 | - return function (Options $options, $value) { |
|
| 208 | + return function(Options $options, $value) { |
|
| 209 | 209 | if (!$value) { |
| 210 | 210 | if ('create' == $this->actionName) { |
| 211 | 211 | $value = LAGAdminBundle::LOAD_STRATEGY_NONE; |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | private function getMenuNormalizer() |
| 230 | 230 | { |
| 231 | - return function (Options $options, $menus) { |
|
| 231 | + return function(Options $options, $menus) { |
|
| 232 | 232 | // set default to an array |
| 233 | 233 | if (false === $menus) { |
| 234 | 234 | $menus = []; |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | private function getCriteriaNormalizer() |
| 248 | 248 | { |
| 249 | - return function (Options $options, $value) { |
|
| 249 | + return function(Options $options, $value) { |
|
| 250 | 250 | if (!$value) { |
| 251 | 251 | $idActions = [ |
| 252 | 252 | 'edit', |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | */ |
| 296 | 296 | private function getFiltersNormalizer(): Closure |
| 297 | 297 | { |
| 298 | - return function (Options $options, $data) { |
|
| 298 | + return function(Options $options, $data) { |
|
| 299 | 299 | $normalizedData = []; |
| 300 | 300 | |
| 301 | 301 | foreach ($data as $name => $field) { |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | private function getRouteDefaultNormalizer(): Closure |
| 323 | 323 | { |
| 324 | - return function (Options $options, $value) { |
|
| 324 | + return function(Options $options, $value) { |
|
| 325 | 325 | if (!is_array($value)) { |
| 326 | 326 | $value = []; |
| 327 | 327 | } |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | |
| 335 | 335 | private function getFormNormalizer(): Closure |
| 336 | 336 | { |
| 337 | - return function (Options $options, $value) { |
|
| 337 | + return function(Options $options, $value) { |
|
| 338 | 338 | if (null !== $value) { |
| 339 | 339 | return $value; |
| 340 | 340 | } |
@@ -363,11 +363,11 @@ discard block |
||
| 363 | 363 | ->get('translation_pattern') |
| 364 | 364 | ; |
| 365 | 365 | |
| 366 | - return function (Options $options, $value) use ($translationPattern, $translation) { |
|
| 366 | + return function(Options $options, $value) use ($translationPattern, $translation) { |
|
| 367 | 367 | if (null === $value) { |
| 368 | 368 | $value = 'lag.admin.'.$this->actionName; |
| 369 | 369 | |
| 370 | - if ($translation && false !== $translationPattern) { |
|
| 370 | + if ($translation && false !== $translationPattern) { |
|
| 371 | 371 | // By default, the action title is action name using the configured translation pattern |
| 372 | 372 | $value = TranslationUtils::getTranslationKey( |
| 373 | 373 | $translationPattern, |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | '_self', |
| 57 | 57 | '_blank', |
| 58 | 58 | ]) |
| 59 | - ->setNormalizer('route', function (Options $options, $value) use ($actionConfiguration) { |
|
| 59 | + ->setNormalizer('route', function(Options $options, $value) use ($actionConfiguration) { |
|
| 60 | 60 | // route or url should be defined |
| 61 | 61 | if (!$value && !$options->offsetGet('url') && !$options->offsetGet('admin')) { |
| 62 | 62 | throw new InvalidOptionsException( |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | return $value; |
| 76 | 76 | }) |
| 77 | - ->setNormalizer('admin', function (Options $options, $value) { |
|
| 77 | + ->setNormalizer('admin', function(Options $options, $value) { |
|
| 78 | 78 | // if a Admin is defined, an Action should be defined too |
| 79 | 79 | if ($value && !$options->offsetGet('action')) { |
| 80 | 80 | throw new InvalidOptionsException( |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | return $value; |
| 86 | 86 | }) |
| 87 | - ->setNormalizer('parameters', function (Options $options, $values) { |
|
| 87 | + ->setNormalizer('parameters', function(Options $options, $values) { |
|
| 88 | 88 | $cleanedValues = []; |
| 89 | 89 | |
| 90 | 90 | foreach ($values as $name => $method) { |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | return $cleanedValues; |
| 98 | 98 | }) |
| 99 | - ->setNormalizer('text', function (Options $options, $value) use ($actionConfiguration) { |
|
| 99 | + ->setNormalizer('text', function(Options $options, $value) use ($actionConfiguration) { |
|
| 100 | 100 | if ($value) { |
| 101 | 101 | return $value; |
| 102 | 102 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | |
| 24 | 24 | $resolver |
| 25 | 25 | ->setDefault('class', '') |
| 26 | - ->setNormalizer('class', function (Options $options, $value) { |
|
| 26 | + ->setNormalizer('class', function(Options $options, $value) { |
|
| 27 | 27 | if ($value) { |
| 28 | 28 | return $value; |
| 29 | 29 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | 'template' => '@LAGAdmin/Field/actionCollection.html.twig', |
| 32 | 32 | 'actions' => [], |
| 33 | 33 | ]) |
| 34 | - ->setNormalizer('actions', function (Options $options, $value) use ($actionConfiguration) { |
|
| 34 | + ->setNormalizer('actions', function(Options $options, $value) use ($actionConfiguration) { |
|
| 35 | 35 | if (!is_array($value) || 0 === count($value)) { |
| 36 | 36 | $value = [ |
| 37 | 37 | 'edit' => [], |