-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: Add configuration for friendsofphp/php-cs-fixer
- Loading branch information
1 parent
8b4300d
commit 4285279
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |