@@ -8,7 +8,6 @@ |
||
| 8 | 8 | use LAG\AdminBundle\Admin\AdminInterface; |
| 9 | 9 | use LAG\AdminBundle\Admin\Configuration\ActionConfiguration; |
| 10 | 10 | use LAG\AdminBundle\Admin\Configuration\ApplicationConfiguration; |
| 11 | -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; |
|
| 12 | 11 | use Symfony\Component\OptionsResolver\Options; |
| 13 | 12 | use Symfony\Component\OptionsResolver\OptionsResolver; |
| 14 | 13 | |
@@ -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]; |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace LAG\AdminBundle\Twig; |
| 4 | 4 | |
| 5 | 5 | use LAG\AdminBundle\Admin\Configuration\ApplicationConfiguration; |
| 6 | -use LAG\AdminBundle\Admin\Field; |
|
| 7 | 6 | use LAG\AdminBundle\Admin\Field\EntityFieldInterface; |
| 8 | 7 | use LAG\AdminBundle\Admin\FieldInterface; |
| 9 | 8 | use Symfony\Component\DependencyInjection\Container; |
@@ -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 | } |
@@ -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(); |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | public function render($value) |
| 51 | 51 | { |
| 52 | 52 | if ($this->length && strlen($value) > $this->length) { |
| 53 | - $value = substr($value, 0, $this->length).$this->replace; |
|
| 53 | + $value = substr($value, 0, $this->length) . $this->replace; |
|
| 54 | 54 | } |
| 55 | 55 | if ($this->translation) { |
| 56 | 56 | $value = $this->translator->trans($value); |
@@ -194,7 +194,7 @@ |
||
| 194 | 194 | $hooks = []; |
| 195 | 195 | |
| 196 | 196 | foreach ($fields as $fieldName) { |
| 197 | - $exporter->addHook(function ($fieldValue) { |
|
| 197 | + $exporter->addHook(function($fieldValue) { |
|
| 198 | 198 | // if field is an array |
| 199 | 199 | if (is_array($fieldValue)) { |
| 200 | 200 | $value = $this->recursiveImplode(', ', $fieldValue); |
@@ -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', [ |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | $configuration = new Configuration(); |
| 23 | 23 | $config = $this->processConfiguration($configuration, $configs); |
| 24 | 24 | |
| 25 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 25 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 26 | 26 | $loader->load('services.yml'); |
| 27 | 27 | |
| 28 | 28 | $container->setParameter('bluebear.admins', $config['admins']); |
@@ -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; |