@@ -34,7 +34,7 @@ |
||
34 | 34 | } |
35 | 35 | // check if they exists in entities displayed and if checkbox is checked |
36 | 36 | foreach ($batchItems as $name => $batchItem) { |
37 | - $batchId = (int)str_replace('batch_', '', $name); |
|
37 | + $batchId = (int) str_replace('batch_', '', $name); |
|
38 | 38 | |
39 | 39 | if (array_key_exists($batchId, $cleanData['labels']) && $batchItem === true) { |
40 | 40 | $cleanData['ids'][] = $batchId; |
@@ -27,7 +27,7 @@ |
||
27 | 27 | public function render($value) |
28 | 28 | { |
29 | 29 | if (!is_array($value) && !($value instanceof Traversable)) { |
30 | - throw new Exception('Value should be an array instead of '.gettype($value)); |
|
30 | + throw new Exception('Value should be an array instead of ' . gettype($value)); |
|
31 | 31 | } |
32 | 32 | if ($value instanceof Collection) { |
33 | 33 | $value = $value->toArray(); |
@@ -83,7 +83,7 @@ |
||
83 | 83 | */ |
84 | 84 | public function setOptions(array $options) |
85 | 85 | { |
86 | - $this->length = (int)$options['length']; |
|
86 | + $this->length = (int) $options['length']; |
|
87 | 87 | $this->replace = $options['replace']; |
88 | 88 | $this->translation = $options['translation']; |
89 | 89 | } |
@@ -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) |
@@ -82,7 +82,7 @@ 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) { |
@@ -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 = [ |
@@ -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 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | // main base template |
61 | 61 | $resolver->setDefault('base_template', 'LAGAdminBundle::admin.layout.html.twig'); |
62 | 62 | $resolver->setAllowedTypes('base_template', 'string'); |
63 | - $resolver->setNormalizer('base_template', function (Options $options, $value) { |
|
63 | + $resolver->setNormalizer('base_template', function(Options $options, $value) { |
|
64 | 64 | // resource must exists |
65 | 65 | $this |
66 | 66 | ->kernel |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | // form block template |
73 | 73 | $resolver->setDefault('block_template', 'LAGAdminBundle:Form:fields.html.twig'); |
74 | 74 | $resolver->setAllowedTypes('block_template', 'string'); |
75 | - $resolver->setNormalizer('block_template', function (Options $options, $value) { |
|
75 | + $resolver->setNormalizer('block_template', function(Options $options, $value) { |
|
76 | 76 | // resource must exists |
77 | 77 | $this |
78 | 78 | ->kernel |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | 'name_pattern' => 'lag.admin.{admin}', |
103 | 103 | ]); |
104 | 104 | $resolver->setAllowedTypes('routing', 'array'); |
105 | - $resolver->setNormalizer('routing', function (Options $options, $value) { |
|
105 | + $resolver->setNormalizer('routing', function(Options $options, $value) { |
|
106 | 106 | |
107 | 107 | // url pattern should contain {admin} and {action} token |
108 | 108 | $urlPattern = $value['url_pattern']; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | 'pattern' => 'lag.admin.{key}' |
131 | 131 | ]); |
132 | 132 | $resolver->setAllowedTypes('translation', 'array'); |
133 | - $resolver->setNormalizer('translation', function (Options $options, $value) { |
|
133 | + $resolver->setNormalizer('translation', function(Options $options, $value) { |
|
134 | 134 | |
135 | 135 | if (!is_bool($value['enabled'])) { |
136 | 136 | throw new InvalidOptionsException('Admin translation enabled parameter should be a boolean'); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | $resolver->setDefault('fields_mapping', $defaultMapping); |
163 | 163 | $resolver->setAllowedTypes('fields_mapping', 'array'); |
164 | - $resolver->setNormalizer('fields_mapping', function (Options $options, $value) use ($defaultMapping) { |
|
164 | + $resolver->setNormalizer('fields_mapping', function(Options $options, $value) use ($defaultMapping) { |
|
165 | 165 | // merge with default mapping to allow override |
166 | 166 | $value = array_merge($defaultMapping, $value); |
167 | 167 |