-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from kubawerlos/feature/allow-symfony-4
Allow Symfony 4
- Loading branch information
Showing
5 changed files
with
45 additions
and
28 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 |
---|---|---|
@@ -1,29 +1,46 @@ | ||
<?php | ||
|
||
$year = date('Y'); | ||
/* | ||
* This file is part of the overtrue/phplint. | ||
* | ||
* (c) overtrue <[email protected]> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
$header = <<<EOF | ||
This file is part of the overtrue/phplint. | ||
(c) $year overtrue <[email protected]> | ||
EOF; | ||
(c) overtrue <[email protected]> | ||
Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header); | ||
This source file is subject to the MIT license that is bundled | ||
with this source code in the file LICENSE. | ||
EOF; | ||
|
||
return Symfony\CS\Config\Config::create() | ||
return PhpCsFixer\Config::create() | ||
->setUsingCache(false) | ||
->setRiskyAllowed(true) | ||
// use default SYMFONY_LEVEL and extra fixers: | ||
->fixers(array( | ||
'header_comment', | ||
'short_array_syntax', | ||
'ordered_use', | ||
->setRules([ | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'header_comment' => [ | ||
'header' => $header, | ||
], | ||
'array_syntax' => ['syntax' => 'short'], | ||
'ordered_imports' => true, | ||
//'strict', | ||
//'strict_param', | ||
'phpdoc_order', // 注释中param throw return等的顺序 | ||
'php4_constructor', //将同名构造方法改为__construct() | ||
)) | ||
->finder( | ||
Symfony\CS\Finder\DefaultFinder::create() | ||
'phpdoc_order' => true, // 注释中param throw return等的顺序 | ||
'no_php4_constructor' => true, //将同名构造方法改为__construct() | ||
]) | ||
->setFinder( | ||
PhpCsFixer\Config::create()->getFinder() | ||
->exclude('vendor') | ||
->in(__DIR__.'/') | ||
->append([ | ||
__FILE__, | ||
]) | ||
) | ||
; |
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
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
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
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