@@ -106,7 +106,7 @@ |
||
| 106 | 106 | * Return action configuration resolver |
| 107 | 107 | * |
| 108 | 108 | * @param OptionsResolver $resolver |
| 109 | - * @param $actionName |
|
| 109 | + * @param string $actionName |
|
| 110 | 110 | * @param Admin|null $admin |
| 111 | 111 | */ |
| 112 | 112 | protected function configureOptionsResolver(OptionsResolver $resolver, $actionName, Admin $admin = null) |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | $resolver->setAllowedTypes('base_template', 'string'); |
| 63 | 63 | $resolver->setNormalizer('base_template', function (Options $options, $value) { |
| 64 | 64 | // resource must exists |
| 65 | - $this |
|
| 65 | + $this |
|
| 66 | 66 | ->kernel |
| 67 | 67 | ->locateResource($value); |
| 68 | 68 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | // main base template |
| 62 | 62 | $resolver->setDefault('base_template', 'LAGAdminBundle::admin.layout.html.twig'); |
| 63 | 63 | $resolver->setAllowedTypes('base_template', 'string'); |
| 64 | - $resolver->setNormalizer('base_template', function (Options $options, $value) { |
|
| 64 | + $resolver->setNormalizer('base_template', function(Options $options, $value) { |
|
| 65 | 65 | // resource must exists |
| 66 | 66 | $this |
| 67 | 67 | ->kernel |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | // form block template |
| 74 | 74 | $resolver->setDefault('block_template', 'LAGAdminBundle:Form:fields.html.twig'); |
| 75 | 75 | $resolver->setAllowedTypes('block_template', 'string'); |
| 76 | - $resolver->setNormalizer('block_template', function (Options $options, $value) { |
|
| 76 | + $resolver->setNormalizer('block_template', function(Options $options, $value) { |
|
| 77 | 77 | // resource must exists |
| 78 | 78 | $this |
| 79 | 79 | ->kernel |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | 'name_pattern' => 'lag.admin.{admin}', |
| 104 | 104 | ]); |
| 105 | 105 | $resolver->setAllowedTypes('routing', 'array'); |
| 106 | - $resolver->setNormalizer('routing', function (Options $options, $value) { |
|
| 106 | + $resolver->setNormalizer('routing', function(Options $options, $value) { |
|
| 107 | 107 | |
| 108 | 108 | // url pattern should contain {admin} and {action} token |
| 109 | 109 | $urlPattern = $value['url_pattern']; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | 'pattern' => 'lag.admin.{key}' |
| 132 | 132 | ]); |
| 133 | 133 | $resolver->setAllowedTypes('translation', 'array'); |
| 134 | - $resolver->setNormalizer('translation', function (Options $options, $value) { |
|
| 134 | + $resolver->setNormalizer('translation', function(Options $options, $value) { |
|
| 135 | 135 | |
| 136 | 136 | if (!is_bool($value['enabled'])) { |
| 137 | 137 | throw new InvalidOptionsException('Admin translation enabled parameter should be a boolean'); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | $resolver->setDefault('fields_mapping', $defaultMapping); |
| 164 | 164 | $resolver->setAllowedTypes('fields_mapping', 'array'); |
| 165 | - $resolver->setNormalizer('fields_mapping', function (Options $options, $value) use ($defaultMapping) { |
|
| 165 | + $resolver->setNormalizer('fields_mapping', function(Options $options, $value) use ($defaultMapping) { |
|
| 166 | 166 | // merge with default mapping to allow override |
| 167 | 167 | $value = array_merge($defaultMapping, $value); |
| 168 | 168 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | $resolver->setDefault('fields_template_mapping', $defaultMapping); |
| 178 | 178 | $resolver->setAllowedTypes('fields_template_mapping', 'array'); |
| 179 | - $resolver->setNormalizer('fields_template_mapping', function (Options $options, $value) use ($defaultMapping) { |
|
| 179 | + $resolver->setNormalizer('fields_template_mapping', function(Options $options, $value) use ($defaultMapping) { |
|
| 180 | 180 | // merge with default mapping to allow override |
| 181 | 181 | $value = array_merge($defaultMapping, $value); |
| 182 | 182 | |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | |
| 37 | 37 | // truncate string if required |
| 38 | 38 | if ($maximumStringLength && strlen($value) > $maximumStringLength) { |
| 39 | - $value = substr($value, 0, $maximumStringLength) . $replaceString; |
|
| 39 | + $value = substr($value, 0, $maximumStringLength).$replaceString; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | return $value; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | // by default, generic controller |
| 97 | 97 | $defaults = [ |
| 98 | - '_controller' => $admin->getConfiguration()->getParameter('controller') . ':' . $action->getName(), |
|
| 98 | + '_controller' => $admin->getConfiguration()->getParameter('controller').':'.$action->getName(), |
|
| 99 | 99 | '_admin' => $admin->getName(), |
| 100 | 100 | '_action' => $action->getName(), |
| 101 | 101 | ]; |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | { |
| 149 | 149 | $array = explode('\\', $namespace); |
| 150 | 150 | $path = array_pop($array); |
| 151 | - $path = strtolower(substr($path, 0, 1)) . substr($path, 1); |
|
| 151 | + $path = strtolower(substr($path, 0, 1)).substr($path, 1); |
|
| 152 | 152 | |
| 153 | 153 | return $path; |
| 154 | 154 | } |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | $resolver |
| 83 | 83 | ->setDefault('route', '') |
| 84 | 84 | ->setAllowedTypes('route', 'string') |
| 85 | - ->setNormalizer('route', function (Options $options, $value) { |
|
| 85 | + ->setNormalizer('route', function(Options $options, $value) { |
|
| 86 | 86 | if (!$value) { |
| 87 | 87 | // if no route was provided, it should be linked to an Admin |
| 88 | 88 | if (!$this->admin) { |
| 89 | - throw new InvalidOptionsException('No route was provided for action : ' . $this->actionName); |
|
| 89 | + throw new InvalidOptionsException('No route was provided for action : '.$this->actionName); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // generate default route from admin |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | ->addAllowedValues('load_strategy', AdminInterface::LOAD_STRATEGY_NONE) |
| 115 | 115 | ->addAllowedValues('load_strategy', AdminInterface::LOAD_STRATEGY_UNIQUE) |
| 116 | 116 | ->addAllowedValues('load_strategy', AdminInterface::LOAD_STRATEGY_MULTIPLE) |
| 117 | - ->setNormalizer('load_strategy', function (Options $options, $value) { |
|
| 117 | + ->setNormalizer('load_strategy', function(Options $options, $value) { |
|
| 118 | 118 | |
| 119 | 119 | if (!$value) { |
| 120 | 120 | if ($this->actionName == 'create') { |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | // criteria used to find entity in the data provider |
| 140 | 140 | $resolver |
| 141 | 141 | ->setDefault('criteria', []) |
| 142 | - ->setNormalizer('criteria', function (Options $options, $value) { |
|
| 142 | + ->setNormalizer('criteria', function(Options $options, $value) { |
|
| 143 | 143 | |
| 144 | 144 | if (!$value) { |
| 145 | 145 | $idActions = [ |