@@ -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; |
@@ -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 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | if (!empty($data['entities'])) { |
| 43 | 43 | /** @var Id $entity */ |
| 44 | 44 | foreach ($data['entities'] as $entity) { |
| 45 | - $form->add('batch_' . $entity->getId(), CheckboxType::class, [ |
|
| 45 | + $form->add('batch_'.$entity->getId(), CheckboxType::class, [ |
|
| 46 | 46 | 'value' => $entity->getId(), |
| 47 | 47 | 'label' => false, |
| 48 | 48 | 'required' => false |
@@ -115,7 +115,7 @@ |
||
| 115 | 115 | $field = new $fieldClass(); |
| 116 | 116 | |
| 117 | 117 | if (!($field instanceof FieldInterface)) { |
| 118 | - throw new Exception("Field class {$fieldClass} must implements " . FieldInterface::class); |
|
| 118 | + throw new Exception("Field class {$fieldClass} must implements ".FieldInterface::class); |
|
| 119 | 119 | } |
| 120 | 120 | $field->setName($fieldName); |
| 121 | 121 | $field->setConfiguration($this->configuration); |
@@ -270,7 +270,7 @@ |
||
| 270 | 270 | } |
| 271 | 271 | $exporter |
| 272 | 272 | ->setOptions($exportType, [ |
| 273 | - 'fileName' => $admin->getName() . '-export-' . date('Y-m-d'), |
|
| 273 | + 'fileName' => $admin->getName().'-export-'.date('Y-m-d'), |
|
| 274 | 274 | ]) |
| 275 | 275 | ->setColumns($exportColumns) |
| 276 | 276 | ->setData($admin->getEntities()); |
@@ -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', [ |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | $configuration = new Configuration(); |
| 24 | 24 | $config = $this->processConfiguration($configuration, $configs); |
| 25 | 25 | |
| 26 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 26 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 27 | 27 | $loader->load('services.yml'); |
| 28 | 28 | |
| 29 | 29 | if (!array_key_exists('application', $config)) { |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | // inform user everything went fine |
| 219 | 219 | $this |
| 220 | 220 | ->messageHandler |
| 221 | - ->handleSuccess('lag.admin.' . $this->name . '.saved'); |
|
| 221 | + ->handleSuccess('lag.admin.'.$this->name.'.saved'); |
|
| 222 | 222 | $success = true; |
| 223 | 223 | } catch (Exception $e) { |
| 224 | 224 | $this |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | // inform user everything went fine |
| 249 | 249 | $this |
| 250 | 250 | ->messageHandler |
| 251 | - ->handleSuccess('lag.admin.' . $this->name . '.deleted'); |
|
| 251 | + ->handleSuccess('lag.admin.'.$this->name.'.deleted'); |
|
| 252 | 252 | $success = true; |
| 253 | 253 | } catch (Exception $e) { |
| 254 | 254 | $this |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | ->findBy($criteria, $orderBy, $limit, $offset); |
| 320 | 320 | } |
| 321 | 321 | if (!is_array($entities) && !($entities instanceof Collection)) { |
| 322 | - throw new Exception('The data provider should return either a collection or an array. Got ' . gettype($entities) . ' instead'); |
|
| 322 | + throw new Exception('The data provider should return either a collection or an array. Got '.gettype($entities).' instead'); |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | if (is_array($entities)) { |