A rule for PHP CS Fixer to enforce double quotes.
composer require --dev gd-75/php-cs-fixer-enforce-double-quotes
In your PHP CS Fixer configuration, add:
use GD75\DoubleQuoteFixer\DoubleQuoteFixer;
use PhpCsFixer\Config;
$config = new Config();
$config
->registerCustomFixers(
[
new DoubleQuoteFixer()
]
)
->setRules(
[
"GD75/double_quote_fixer" => true,
]
);
Before auto-fixing quotes on your project, please run a dry-run with diffs to make sure the fixer works correctly.
I'd like to thank the people who spend time to improve the project !
- Androl Genhald (tests & improvements on supported strings)
- Create a configuration for the allowance of single quoted strings when it contains a double quote