Skip to content

Commit

Permalink
Enhancement: Add configuration for friendsofphp/php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Jun 24, 2020
1 parent 8b4300d commit 4285279
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

declare(strict_types=1);

/*
* This file is part of Tree.
*
* (c) 2013 Nicolò Martini
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Ergebnis\PhpCsFixer;
use PhpCsFixer\Fixer;

$header = <<<'TXT'
This file is part of Tree.
(c) 2013 Nicolò Martini
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
TXT;

$config = PhpCsFixer\Config\Factory::fromRuleSet(new PhpCsFixer\Config\RuleSet\Php71(), [
'declare_strict_types' => false,
'final_class' => false,
'header_comment' => [
'comment_type' => Fixer\Comment\HeaderCommentFixer::HEADER_COMMENT,
'header' => \trim($header),
'location' => 'after_declare_strict',
'separate' => 'both',
],
'void_return' => false,
]);

$config->getFinder()
->ignoreDotFiles(false)
->in(__DIR__)
->exclude([
'.build/',
'.github/',
])
->name('.php_cs');

$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/.php_cs.cache');

return $config;

0 comments on commit 4285279

Please sign in to comment.