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

A rule for PHP CS Fixer to enforce double quotes.

1.1.0 2022-07-12 06:00 UTC

This package is auto-updated.

Last update: 2024-04-12 09:50:27 UTC


README

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