Browse Source

Merge branch '2.3'

Sullivan SENECHAL 9 năm trước cách đây
mục cha
commit
38666e6997

+ 7 - 20
.php_cs

@@ -1,5 +1,10 @@
 <?php
 <?php
 
 
+require_once __DIR__.'/vendor/sllh/php-cs-fixer-styleci-bridge/autoload.php';
+
+use SLLH\StyleCIBridge\ConfigBridge;
+use Symfony\CS\Fixer\Contrib\HeaderCommentFixer;
+
 $header = <<<EOF
 $header = <<<EOF
 This file is part of the Sonata Project package.
 This file is part of the Sonata Project package.
 
 
@@ -9,26 +14,8 @@ For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.
 file that was distributed with this source code.
 EOF;
 EOF;
 
 
-Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);
-
-$finder = Symfony\CS\Finder\DefaultFinder::create()
-    ->in(array(__DIR__))
-    ->exclude(array('Tests/Fixtures'))
-;
+HeaderCommentFixer::setHeader($header);
 
 
-return Symfony\CS\Config\Config::create()
-    ->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
-    ->fixers(array(
-        'header_comment',
-        '-unalign_double_arrow',
-        '-unalign_equals',
-        'align_double_arrow',
-        'newline_after_open_tag',
-        'ordered_use',
-        'long_array_syntax',
-        'php_unit_construct',
-        'php_unit_strict',
-    ))
+return ConfigBridge::create()
     ->setUsingCache(true)
     ->setUsingCache(true)
-    ->finder($finder)
 ;
 ;

+ 17 - 0
.styleci.yml

@@ -0,0 +1,17 @@
+preset: symfony
+
+enabled:
+  - align_double_arrow
+  - newline_after_open_tag
+  - ordered_use
+  - long_array_syntax
+  - php_unit_construct
+  - php_unit_strict
+
+disabled:
+  - unalign_double_arrow
+  - unalign_equals
+
+finder:
+  exclude:
+    - Tests/Fixtures

+ 0 - 2
.travis.yml

@@ -20,8 +20,6 @@ env:
 matrix:
 matrix:
   fast_finish: true
   fast_finish: true
   include:
   include:
-    - php: 7.0
-      env: TARGET=cs_dry_run
     - php: 7.0
     - php: 7.0
       env: TARGET=docs
       env: TARGET=docs
     - php: 5.3
     - php: 5.3

+ 0 - 2
Admin/AdminInterface.php

@@ -632,8 +632,6 @@ interface AdminInterface
      */
      */
     public function getDataSourceIterator();
     public function getDataSourceIterator();
 
 
-    /**
-     */
     public function configure();
     public function configure();
 
 
     /**
     /**

+ 2 - 2
Builder/ListBuilderInterface.php

@@ -36,7 +36,7 @@ interface ListBuilderInterface extends BuilderInterface
      * @param FieldDescriptionInterface $fieldDescription
      * @param FieldDescriptionInterface $fieldDescription
      * @param AdminInterface            $admin
      * @param AdminInterface            $admin
      */
      */
-    public function buildField($type = null, FieldDescriptionInterface $fieldDescription, AdminInterface $admin);
+    public function buildField($type, FieldDescriptionInterface $fieldDescription, AdminInterface $admin);
 
 
     /**
     /**
      * Modify a field description and add it to the displayed columns.
      * Modify a field description and add it to the displayed columns.
@@ -46,5 +46,5 @@ interface ListBuilderInterface extends BuilderInterface
      * @param FieldDescriptionInterface  $fieldDescription
      * @param FieldDescriptionInterface  $fieldDescription
      * @param AdminInterface             $admin
      * @param AdminInterface             $admin
      */
      */
-    public function addField(FieldDescriptionCollection $list, $type = null, FieldDescriptionInterface $fieldDescription, AdminInterface $admin);
+    public function addField(FieldDescriptionCollection $list, $type, FieldDescriptionInterface $fieldDescription, AdminInterface $admin);
 }
 }

+ 1 - 1
Builder/ShowBuilderInterface.php

@@ -37,5 +37,5 @@ interface ShowBuilderInterface extends BuilderInterface
      * @param FieldDescriptionInterface  $fieldDescription
      * @param FieldDescriptionInterface  $fieldDescription
      * @param AdminInterface             $admin
      * @param AdminInterface             $admin
      */
      */
-    public function addField(FieldDescriptionCollection $list, $type = null, FieldDescriptionInterface $fieldDescription, AdminInterface $admin);
+    public function addField(FieldDescriptionCollection $list, $type, FieldDescriptionInterface $fieldDescription, AdminInterface $admin);
 }
 }

+ 1 - 1
Command/GenerateAdminCommand.php

@@ -252,7 +252,7 @@ class GenerateAdminCommand extends ContainerAwareCommand
         foreach ($application->getKernel()->getBundles() as $bundle) {
         foreach ($application->getKernel()->getBundles() as $bundle) {
             if (strpos($class, $bundle->getNamespace().'\\') === 0) {
             if (strpos($class, $bundle->getNamespace().'\\') === 0) {
                 return $bundle->getName();
                 return $bundle->getName();
-            };
+            }
         }
         }
 
 
         return;
         return;

+ 0 - 2
Datagrid/DatagridInterface.php

@@ -37,8 +37,6 @@ interface DatagridInterface
      */
      */
     public function getResults();
     public function getResults();
 
 
-    /**
-     */
     public function buildPager();
     public function buildPager();
 
 
     /**
     /**

+ 1 - 1
DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php

@@ -74,7 +74,7 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
 
 
                 $classes[$arguments[1]][] = $id;
                 $classes[$arguments[1]][] = $id;
 
 
-                $showInDashboard = (boolean) (isset($attributes['show_in_dashboard']) ?  $parameterBag->resolveValue($attributes['show_in_dashboard']) : true);
+                $showInDashboard = (bool) (isset($attributes['show_in_dashboard']) ?  $parameterBag->resolveValue($attributes['show_in_dashboard']) : true);
                 if (!$showInDashboard) {
                 if (!$showInDashboard) {
                     continue;
                     continue;
                 }
                 }

+ 1 - 1
DependencyInjection/SonataAdminExtension.php

@@ -37,7 +37,7 @@ class SonataAdminExtension extends Extension implements PrependExtensionInterfac
         $bundles = $container->getParameter('kernel.bundles');
         $bundles = $container->getParameter('kernel.bundles');
 
 
         if (!isset($bundles['SonataCoreBundle'])) {
         if (!isset($bundles['SonataCoreBundle'])) {
-            throw new \RuntimeException(<<<BOOM
+            throw new \RuntimeException(<<<'BOOM'
 Boom! you are living on the edge ;) The AdminBundle requires the CoreBundle!
 Boom! you are living on the edge ;) The AdminBundle requires the CoreBundle!
 Please add ``"sonata-project/core-bundle": "~2.2"`` into your composer.json file and add the SonataCoreBundle into the AppKernel');
 Please add ``"sonata-project/core-bundle": "~2.2"`` into your composer.json file and add the SonataCoreBundle into the AppKernel');
 BOOM
 BOOM

+ 0 - 6
Makefile

@@ -1,9 +1,3 @@
-cs:
-	php-cs-fixer fix --verbose
-
-cs_dry_run:
-	php-cs-fixer fix --verbose --dry-run
-
 test:
 test:
 	phpunit
 	phpunit
 
 

+ 1 - 1
Manipulator/ServicesManipulator.php

@@ -99,6 +99,6 @@ class ServicesManipulator
                 $serviceId,
                 $serviceId,
                 $this->file
                 $this->file
             ));
             ));
-        };
+        }
     }
     }
 }
 }

+ 2 - 1
composer.json

@@ -47,7 +47,8 @@
         "sensio/generator-bundle": "^2.3 || ^3.0",
         "sensio/generator-bundle": "^2.3 || ^3.0",
         "symfony/yaml": "^2.3 || ^3.0",
         "symfony/yaml": "^2.3 || ^3.0",
         "sonata-project/intl-bundle": "^2.2.4",
         "sonata-project/intl-bundle": "^2.2.4",
-        "symfony/phpunit-bridge": "^2.7 || ^3.0"
+        "symfony/phpunit-bridge": "^2.7 || ^3.0",
+        "sllh/php-cs-fixer-styleci-bridge": "^2.0"
     },
     },
     "conflict": {
     "conflict": {
         "jms/di-extra-bundle": "<1.7.0"
         "jms/di-extra-bundle": "<1.7.0"