Skip to content

Commit

Permalink
Updated cs-fixer config
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Jan 9, 2019
1 parent 69e4f44 commit f7694a9
Showing 1 changed file with 22 additions and 42 deletions.
64 changes: 22 additions & 42 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
<?php

// try to get Symfony's PHPunit Bridge
$files = array_filter(array(
__DIR__.'/vendor/sllh/php-cs-fixer-styleci-bridge/autoload.php',
__DIR__.'/../../../vendor/sllh/php-cs-fixer-styleci-bridge/autoload.php',
), 'file_exists');

if (count($files) > 0) {
require_once current($files);
}

use SLLH\StyleCIBridge\ConfigBridge;

$header = <<<EOF
(c) Christian Gripp <mail@core23.de>
Expand All @@ -20,39 +8,31 @@ file that was distributed with this source code.
EOF;

$rules = [
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP70Migration' => true,
'@PHP71Migration:risky' => true,
'array_syntax' => [
'syntax' => 'short',
],
'binary_operator_spaces' => [
'default' => 'align',
],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'header_comment' => [
'header' => $header,
],
'no_extra_consecutive_blank_lines' => true,
'no_php4_constructor' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
'php_unit_strict' => true,
];

$finder = PhpCsFixer\Finder::create()
->in( __DIR__)
->exclude('tests/Fixtures')
->in([ __DIR__.'/src', __DIR__.'/tests'])
;
return PhpCsFixer\Config::create()
->setFinder($finder)

$config = PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules($rules)
->setUsingCache(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP70Migration' => true,
'@PHP71Migration:risky' => true,
'@PHPUnit60Migration:risky' => true,
'header_comment' => [
'header' => $header,
],
'list_syntax' => [
'syntax' => 'short',
],
'binary_operator_spaces' => [
'default' => 'align',
],
])
->setFinder($finder)
;

return $config;

0 comments on commit f7694a9

Please sign in to comment.