@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | 'url_pattern', |
147 | 147 | 'name_pattern', |
148 | 148 | ]); |
149 | - $resolver->setNormalizer('url_pattern', function (Options $options, $value) { |
|
149 | + $resolver->setNormalizer('url_pattern', function(Options $options, $value) { |
|
150 | 150 | if (strstr($value, '{admin}') === false) { |
151 | 151 | throw new InvalidOptionsException('Admin routing configuration url pattern should contains {admin} placeholder'); |
152 | 152 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | return $value; |
158 | 158 | }); |
159 | - $resolver->setNormalizer('name_pattern', function (Options $options, $value) { |
|
159 | + $resolver->setNormalizer('name_pattern', function(Options $options, $value) { |
|
160 | 160 | if (strstr($value, '{admin}') === false) { |
161 | 161 | throw new InvalidOptionsException('Admin routing configuration pattern name should contains {admin} placeholder'); |
162 | 162 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | ->clear() |
175 | 175 | ->setDefault('enabled', true) |
176 | 176 | ->setDefault('pattern', 'lag.admin.{key}'); |
177 | - $resolver->setNormalizer('pattern', function (Options $options, $value) { |
|
177 | + $resolver->setNormalizer('pattern', function(Options $options, $value) { |
|
178 | 178 | if (strstr($value, 'key') === false) { |
179 | 179 | throw new InvalidOptionsException('Admin translation configuration pattern should contains {key} placeholder'); |
180 | 180 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | } |
224 | 224 | |
225 | 225 | /** |
226 | - * @return mixed |
|
226 | + * @return string |
|
227 | 227 | */ |
228 | 228 | public function getTitle() |
229 | 229 | { |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |
242 | - * @return mixed |
|
242 | + * @return string |
|
243 | 243 | */ |
244 | 244 | public function getLayout() |
245 | 245 | { |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | } |
256 | 256 | |
257 | 257 | /** |
258 | - * @return mixed |
|
258 | + * @return string |
|
259 | 259 | */ |
260 | 260 | public function getBlockTemplate() |
261 | 261 | { |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | } |
272 | 272 | |
273 | 273 | /** |
274 | - * @return mixed |
|
274 | + * @return string |
|
275 | 275 | */ |
276 | 276 | public function getDescription() |
277 | 277 | { |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | } |
304 | 304 | |
305 | 305 | /** |
306 | - * @return mixed |
|
306 | + * @return string |
|
307 | 307 | */ |
308 | 308 | public function getDateFormat() |
309 | 309 | { |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | } |
398 | 398 | |
399 | 399 | /** |
400 | - * @return mixed |
|
400 | + * @return integer |
|
401 | 401 | */ |
402 | 402 | public function getStringLengthTruncate() |
403 | 403 | { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | Admin::LOAD_STRATEGY_UNIQUE, |
158 | 158 | Admin::LOAD_STRATEGY_MULTIPLE, |
159 | 159 | ]) |
160 | - ->setNormalizer('route', function (Options $options, $value) use ($admin, $actionName) { |
|
160 | + ->setNormalizer('route', function(Options $options, $value) use ($admin, $actionName) { |
|
161 | 161 | if (!$value) { |
162 | 162 | // if no route was provided, it should be linked to an Admin |
163 | 163 | if (!$admin) { |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | return $value; |
170 | 170 | }) |
171 | - ->setNormalizer('title', function (Options $options, $value) use ($admin, $actionName) { |
|
171 | + ->setNormalizer('title', function(Options $options, $value) use ($admin, $actionName) { |
|
172 | 172 | if (!$value) { |
173 | 173 | $adminKey = ''; |
174 | 174 | // if an Admin is linked to this action, we use its name in translation key |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | } |
180 | 180 | return $value; |
181 | 181 | }) |
182 | - ->setNormalizer('batch', function (Options $options, $value) use ($admin, $actionName) { |
|
182 | + ->setNormalizer('batch', function(Options $options, $value) use ($admin, $actionName) { |
|
183 | 183 | if ($value) { |
184 | 184 | if (!is_array($value)) { |
185 | 185 | $value = [$value]; |
@@ -25,7 +25,7 @@ |
||
25 | 25 | // foreach tagged, with add this field type to the field factory |
26 | 26 | foreach ($taggedServices as $id => $tags) { |
27 | 27 | if (empty($tags[0]['type'])) { |
28 | - throw new InvalidConfigurationException('You should defined a "type" attribute for field tag for service '.$id); |
|
28 | + throw new InvalidConfigurationException('You should defined a "type" attribute for field tag for service ' . $id); |
|
29 | 29 | } |
30 | 30 | // add allowed field type to the field factory |
31 | 31 | $definition->addMethodCall('addFieldMapping', [ |
@@ -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; |
@@ -32,7 +32,7 @@ |
||
32 | 32 | ] |
33 | 33 | ]) |
34 | 34 | ; |
35 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
35 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
36 | 36 | $data = $event->getData(); |
37 | 37 | $form = $event->getForm(); |
38 | 38 |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $path = str_replace('{action}', $action->getName(), $path); |
94 | 94 | // by default, generic controller |
95 | 95 | $defaults = [ |
96 | - '_controller' => $admin->getConfiguration()->getControllerName().':'.$action->getName(), |
|
96 | + '_controller' => $admin->getConfiguration()->getControllerName() . ':' . $action->getName(), |
|
97 | 97 | '_admin' => $admin->getName(), |
98 | 98 | '_action' => $action->getName(), |
99 | 99 | ]; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | { |
136 | 136 | $array = explode('\\', $namespace); |
137 | 137 | $path = array_pop($array); |
138 | - $path = strtolower(substr($path, 0, 1)).substr($path, 1); |
|
138 | + $path = strtolower(substr($path, 0, 1)) . substr($path, 1); |
|
139 | 139 | |
140 | 140 | return $path; |
141 | 141 | } |
@@ -358,7 +358,7 @@ |
||
358 | 358 | } |
359 | 359 | |
360 | 360 | /** |
361 | - * @return array |
|
361 | + * @return integer[] |
|
362 | 362 | */ |
363 | 363 | public function getActionNames() |
364 | 364 | { |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $hooks = []; |
250 | 250 | |
251 | 251 | foreach ($fields as $fieldName) { |
252 | - $exporter->addHook(function ($fieldValue) { |
|
252 | + $exporter->addHook(function($fieldValue) { |
|
253 | 253 | // if field is an array |
254 | 254 | if (is_array($fieldValue)) { |
255 | 255 | $value = recursiveImplode(', ', $fieldValue); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | $this->forward404Unless( |
295 | 295 | $admin->isActionGranted($admin->getCurrentAction()->getName(), $roles), |
296 | 296 | sprintf('User with roles %s not allowed for action "%s"', |
297 | - implode(', ', array_map(function (Role $role) { |
|
297 | + implode(', ', array_map(function(Role $role) { |
|
298 | 298 | return $role->getRole(); |
299 | 299 | }, $roles)), |
300 | 300 | $admin->getCurrentAction()->getName() |
@@ -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(); |