Convert double quotes to single quotes for simple strings.
Whether to fix double-quoted strings that contains single-quotes.
Allowed types: bool
Default value: false
Default configuration.
--- Original
+++ New
@@ -1,4 +1,4 @@
<?php
-$a = "sample";
+$a = 'sample';
$b = "sample with 'single-quotes'";
With configuration: ['strings_containing_single_quote_chars' => true]
.
--- Original
+++ New
@@ -1,4 +1,4 @@
<?php
-$a = "sample";
-$b = "sample with 'single-quotes'";
+$a = 'sample';
+$b = 'sample with \'single-quotes\'';
The rule is part of the following rule sets:
- @PhpCsFixer
- Using the @PhpCsFixer rule set will enable the
single_quote
rule with the default config. - @Symfony
- Using the @Symfony rule set will enable the
single_quote
rule with the default config.