doc/rules/string_notation/single_quote.rst
single_quoteConvert double quotes to single quotes for simple strings.
This rule is CONFIGURABLE
You can configure this rule using the following option:
``strings_containing_single_quote_chars``.
Configuration
-------------
``strings_containing_single_quote_chars``
Whether to fix double-quoted strings that contains single-quotes.
Allowed types: bool
Default value: false
Example #1
*Default* configuration.
.. code-block:: diff
--- Original
+++ New
<?php
-$a = "sample";
+$a = 'sample';
$b = "sample with 'single-quotes'";
Example #2
With configuration: ['strings_containing_single_quote_chars' => true].
.. code-block:: diff
--- 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:
@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>_@Symfony <./../../ruleSets/Symfony.rst>_PhpCsFixer\\Fixer\\StringNotation\\SingleQuoteFixer <./../../../src/Fixer/StringNotation/SingleQuoteFixer.php>_PhpCsFixer\\Tests\\Fixer\\StringNotation\\SingleQuoteFixerTest <./../../../tests/Fixer/StringNotation/SingleQuoteFixerTest.php>_The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.