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
<?php
-$a = "sample";
+$a = 'sample';
$b = "sample with 'single-quotes'";
With configuration: ['strings_containing_single_quote_chars' => true]
.
--- Original
+++ New
<?php
-$a = "sample";
-$b = "sample with 'single-quotes'";
+$a = 'sample';
+$b = 'sample with \'single-quotes\'';
The rule is part of the following rule sets: