-
-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
224 changed files
with
754 additions
and
722 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,7 @@ | ||
#!/bin/bash | ||
|
||
## Description: run PHP-CS-Fixer | ||
## Usage: php-cs-fixer | ||
## Example: ddev php-cs-fixer <path-to-files> | ||
|
||
php vendor/bin/php-cs-fixer fix "$@" |
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,17 +1,32 @@ | ||
<?php | ||
|
||
use PhpCsFixer\Config; | ||
use PhpCsFixer\Finder; | ||
declare(strict_types=1); | ||
|
||
$finder = (new Finder()) | ||
->in('.'); | ||
|
||
return (new Config()) | ||
$config = new PhpCsFixer\Config(); | ||
return $config | ||
->setRiskyAllowed(true) | ||
->setFinder($finder) | ||
->setRules([ | ||
'array_syntax' => ['syntax' => 'short'], | ||
'modernize_types_casting' => true, | ||
// see https://cs.symfony.com/doc/ruleSets/PER-CS2.0.html | ||
'@PER-CS2.0' => true, | ||
// RISKY: Use && and || logical operators instead of and or. | ||
'logical_operators' => true, | ||
// RISKY: Replaces intval, floatval, doubleval, strval and boolval function calls with according type casting operator. | ||
'modernize_types_casting' => true, | ||
// PHP84: Adds or removes ? before single type declarations or |null at the end of union types when parameters have a default null value. | ||
'nullable_type_declaration_for_default_null_value' => true, | ||
// Convert double quotes to single quotes for simple strings. | ||
'single_quote' => true, | ||
]); | ||
// Arguments lists, array destructuring lists, arrays that are multi-line, match-lines and parameters lists must have a trailing comma. | ||
// removed "match" and "parameters" for PHP7 | ||
// see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8308 | ||
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arguments', 'array_destructuring', 'arrays']], | ||
]) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->in([ | ||
__DIR__, | ||
]) | ||
->name('*.php') | ||
->ignoreDotFiles(true) | ||
->ignoreVCS(true) | ||
); |
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
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.