Skip to content

Commit

Permalink
Update php-cs-fixer configuration
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
allejo committed Feb 8, 2018
1 parent 2bd8e73 commit 8c2dcae
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 44 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Thumbs.db
*~
node_modules
.sass-cache
.eyeglass_cache
.php_cs
composer.phar

# IDE files #
Expand Down
44 changes: 0 additions & 44 deletions .php_cs

This file was deleted.

65 changes: 65 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

/*
* This file is part of the BZiON project.
*
* (c) Copyright 2013-2018 Vladimir Jimenez
* (c) Copyright 2018 BZFlag & Associates
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

$finder = PhpCsFixer\Finder::create()
->in('app')
->in('controllers')
->in('migrations')
->in('models')
->in('src')
->in('tests')
->exclude('cache')
;

$licenseHeader = <<<EOL
This file is part of the BZiON project.
(c) Copyright 2013-2018 Vladimir Jimenez
(c) Copyright 2018 BZFlag & Associates
For the full copyright and license information, please view the LICENSE.md
file that was distributed with this source code.
EOL;

return PhpCsFixer\Config::create()
->setRules([
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'concat_space' => ['spacing' => 'one'],
'header_comment' => [
'header' => $licenseHeader,
'commentType' => 'comment',
'location' => 'after_open',
'separate' => 'both',
],
'no_short_echo_tag' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => [
'sortAlgorithm' => 'alpha',
'importsOrder' => [
'const',
'class',
'function',
],
],
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
'phpdoc_order' => true,
'php_unit_fqcn_annotation' => true, // @todo Change this when PHPUnit 6 is the new minimum version
'ternary_to_null_coalescing' => false, // @todo Change this when PHP 7.0 is the minimum version
'yoda_style' => [
'equal' => false,
'identical' => false,
],
])
->setFinder($finder)
;

0 comments on commit 8c2dcae

Please sign in to comment.