-
-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #487 Add PHP-CS-Fixer (HypeMC)
This PR was squashed before being merged into the 3.x-dev branch. Discussion ---------- Add PHP-CS-Fixer This repo seems to be the only one that doesn't use PHP-CS-Fixer, which is a bit annoying when trying to contribute since I have to manually worry about coding standards. I'm not sure if there's a specific reason for that, so I decided to give it a try in this PR. I took the `.php-cs-fixer.dist.php` from the framework repo and made a few adjustments. I removed `nullable_type_declaration` and `nullable_type_declaration_for_default_null_value` since those are part of the standard Symfony set. Additionally, I set `modernize_strpos` to `false` since the bundle still supports PHP >= 7.2. I'm not sure how to run it in the CI, as some repos use fabbot while others, like the MakerBundle, use GitHub Actions. It would be best to hide whitespace changes while reviewing. Commits ------- 7fe4fbd Add PHP-CS-Fixer
- Loading branch information
Showing
22 changed files
with
917 additions
and
875 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
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,4 +1,5 @@ | ||
vendor | ||
.php-cs-fixer.cache | ||
composer.phar | ||
composer.lock | ||
phpunit.xml | ||
|
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,38 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
$fileHeaderComment = <<<'EOF' | ||
This file is part of the Symfony package. | ||
(c) Fabien Potencier <fabien@symfony.com> | ||
For the full copyright and license information, please view the LICENSE | ||
file that was distributed with this source code. | ||
EOF; | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setRules([ | ||
'@PHP71Migration' => true, | ||
'@PHPUnit75Migration:risky' => true, | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'protected_to_private' => false, | ||
'header_comment' => ['header' => $fileHeaderComment], | ||
'modernize_strpos' => false, | ||
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'match', 'parameters']], | ||
]) | ||
->setRiskyAllowed(true) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->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
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
Oops, something went wrong.