Skip to content

gd-75/php-cs-fixer-enforce-double-quotes

Repository files navigation

gd-75/php-cs-fixer-enforce-double-quotes

php-cs-fixer-enforce-double-quotes

A rule for PHP CS Fixer to enforce double quotes.

Installation and usage

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,
        ]
    );

Warning

Before auto-fixing quotes on your project, please run a dry-run with diffs to make sure the fixer works correctly.

Contributors

I'd like to thank the people who spend time to improve the project !

  • Androl Genhald (tests & improvements on supported strings)

TO-DO

  • Create a configuration for the allowance of single quoted strings when it contains a double quote

About

A rule for PHP CS Fixer to enforce double quotes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages