Ver Fonte

Applied fixes from StyleCI (#3892)

Sullivan SENECHAL há 9 anos atrás
pai
commit
37e351408d

+ 3 - 1
Annotation/Admin.php

@@ -108,7 +108,9 @@ class Admin implements MetadataProcessorInterface
             'persist_filters' => $this->persistFilters,
         );
 
-        $tag = array_filter($tag, function ($v) { return !is_null($v); });
+        $tag = array_filter($tag, function ($v) {
+            return !is_null($v);
+        });
         $metadata->tags['sonata.admin'][] = $tag;
         $metadata->arguments = array($this->id, $this->class, $this->baseControllerName);
 

+ 6 - 2
Datagrid/Datagrid.php

@@ -128,8 +128,12 @@ class Datagrid implements DatagridInterface
 
         $this->formBuilder->add('_sort_by', 'hidden');
         $this->formBuilder->get('_sort_by')->addViewTransformer(new CallbackTransformer(
-            function ($value) { return $value; },
-            function ($value) { return $value instanceof FieldDescriptionInterface ? $value->getName() : $value; }
+            function ($value) {
+                return $value;
+            },
+            function ($value) {
+                return $value instanceof FieldDescriptionInterface ? $value->getName() : $value;
+            }
         ));
 
         $this->formBuilder->add('_sort_order', 'hidden');

+ 3 - 1
DependencyInjection/Configuration.php

@@ -52,7 +52,9 @@ class Configuration implements ConfigurationInterface
                                 ->performNoDeepMerging()
                                 ->beforeNormalization()
                                     ->ifString()
-                                    ->then(function ($v) { return array($v); })
+                                    ->then(function ($v) {
+                                        return array($v);
+                                    })
                                 ->end()
                                 ->prototype('scalar')->end()
                             ->end()

+ 0 - 1
Form/Type/ModelType.php

@@ -111,7 +111,6 @@ class ModelType extends AbstractType
                     $options['choices'],
                     $propertyAccessor
                 );
-
             };
         } else {
             $options['choice_list'] = function (Options $options, $previousValue) use ($propertyAccessor) {

+ 0 - 1
Tests/Command/GenerateAdminCommandTest.php

@@ -222,7 +222,6 @@ class GenerateAdminCommandTest extends \PHPUnit_Framework_TestCase
             $dialog->expects($this->any())
                 ->method('askAndValidate')
                 ->will($this->returnCallback(function (OutputInterface $output, $question, $validator, $attempts = false, $default = null) use ($modelEntity) {
-
                     $questionClean = substr($question, 6, strpos($question, '</info>') - 6);
 
                     switch ($questionClean) {

+ 6 - 7
Tests/Controller/CRUDControllerTest.php

@@ -234,7 +234,6 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             $this->csrfProvider->expects($this->any())
                 ->method('isTokenValid')
                 ->will($this->returnCallback(function (CsrfToken $token) {
-
                     if ($token->getValue() == 'csrf-token-123_'.$token->getId()) {
                         return true;
                     }
@@ -774,8 +773,8 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
         $modelManager->expects($this->once())
             ->method('batchDelete')
             ->will($this->returnCallback(function () {
-                    throw new ModelManagerException();
-                }));
+                throw new ModelManagerException();
+            }));
 
         $this->admin->expects($this->once())
             ->method('getModelManager')
@@ -1145,8 +1144,8 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
         $this->admin->expects($this->once())
             ->method('delete')
             ->will($this->returnCallback(function () {
-                    throw new ModelManagerException();
-                }));
+                throw new ModelManagerException();
+            }));
 
         $this->kernel->expects($this->once())
             ->method('isDebug')
@@ -3680,8 +3679,8 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
         $subject->expects($this->once())
             ->method($method)
             ->will($this->returnCallback(function () use ($exception) {
-                    throw $exception;
-                }));
+                throw $exception;
+            }));
 
         $this->logger->expects($this->once())
             ->method('error')

+ 5 - 5
Tests/Controller/HelperControllerTest.php

@@ -496,12 +496,12 @@ class HelperControllerTest extends \PHPUnit_Framework_TestCase
         $this->admin->expects($this->exactly(2))
             ->method('isGranted')
              ->will($this->returnCallback(function ($operation) {
-                if ($operation == 'CREATE' || $operation == 'EDIT') {
-                    return false;
-                }
+                 if ($operation == 'CREATE' || $operation == 'EDIT') {
+                     return false;
+                 }
 
-                return;
-            }));
+                 return;
+             }));
 
         $request = new Request(array(
             'admin_code' => 'foo.admin',

+ 1 - 1
Tests/Datagrid/DatagridMapperTest.php

@@ -212,7 +212,7 @@ class DatagridMapperTest extends \PHPUnit_Framework_TestCase
                 $tmpNames[$name] = $name;
 
                 return false;
-        }));
+            }));
 
         try {
             $this->datagridMapper->add('fooName');

+ 3 - 1
Tests/Form/Widget/FormSonataFilterChoiceWidgetTest.php

@@ -85,7 +85,9 @@ class FormSonataFilterChoiceWidgetTest extends BaseWidgetTest
 
         $mock->expects($this->exactly(3))
             ->method('trans')
-            ->will($this->returnCallback(function ($arg) { return $arg; })
+            ->will($this->returnCallback(function ($arg) {
+                return $arg;
+            })
             );
 
         $extensions = parent::getExtensions();

+ 0 - 1
Tests/Security/Handler/RoleSecurityHandlerTest.php

@@ -84,7 +84,6 @@ class RoleSecurityHandlerTest extends \PHPUnit_Framework_TestCase
         $this->authorizationChecker->expects($this->any())
             ->method('isGranted')
             ->will($this->returnCallback(function (array $attributes, $object) {
-
                 if (in_array('ROLE_BATMAN', $attributes)) {
                     return true;
                 }