Use PHP-CS-FIXER 2.0

This commit is contained in:
Guilhem N 2016-11-30 16:52:13 +01:00
parent e221047351
commit 9efcc24cdd
No known key found for this signature in database
GPG Key ID: 9E5D2DB67BF054DD
4 changed files with 28 additions and 28 deletions

2
.gitignore vendored
View File

@ -1,6 +1,8 @@
/vendor/
/composer.phar
/composer.lock
/.php_cs.cache
/.php_cs
/phpunit.xml
/Tests/Functional/cache
/Tests/Functional/logs

27
.php_cs
View File

@ -1,27 +0,0 @@
<?php
use Symfony\CS\Config\Config;
use Symfony\CS\Finder\DefaultFinder;
use Symfony\CS\Fixer\Contrib\HeaderCommentFixer;
use Symfony\CS\FixerInterface;
$finder = DefaultFinder::create()
->in(__DIR__)
;
$header = <<<EOF
This file is part of the ApiDocBundle package.
(c) EXSyst
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;
HeaderCommentFixer::setHeader($header);
return Config::create()
->level(FixerInterface::SYMFONY_LEVEL)
->fixers(['header_comment', 'short_array_syntax'])
->finder($finder)
->setUsingCache(true)
;

25
.php_cs.dist Normal file
View File

@ -0,0 +1,25 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('tests/Fixtures/app/cache')
;
return PhpCsFixer\Config::create()
->setRules([
'@Symfony' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
'header_comment' => [
'header' => <<<COMMENT
This file is part of the ApiDocBundle package.
(c) EXSyst
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
COMMENT
],
])
->setFinder($finder)
;

View File

@ -13,11 +13,11 @@ namespace EXSyst\Bundle\ApiDocBundle\Tests\Describer;
use EXSyst\Bundle\ApiDocBundle\Describer\RouteDescriber;
use EXSyst\Bundle\ApiDocBundle\RouteDescriber\RouteDescriberInterface;
use EXSyst\Component\Swagger\Swagger;
use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use EXSyst\Component\Swagger\Swagger;
class RouteDescriberTest extends AbstractDescriberTest
{