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

A rule for PHP CS Fixer to enforce double quotes.

Maintainers

👁 gd-75

Package info

github.com/gd-75/php-cs-fixer-enforce-double-quotes

pkg:composer/gd-75/php-cs-fixer-enforce-double-quotes

Statistics

Installs: 31 649

Dependents: 5

Suggesters: 0

Stars: 6

Open Issues: 0

1.1.0 2022-07-12 06:00 UTC

Requires

  • php: >=7.4

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT ceca7ff8006caede6ef09cc5d9958a1d9f5b2472

This package is auto-updated.

Last update: 2026-06-12 14:22:28 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