Skip to content

Commit

Permalink
norm backslashes in single quoted strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Apr 30, 2024
1 parent 81b4ddb commit cd21ad8
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
'modernize_strpos' => true, // needs PHP 8+ or polyfill
'no_useless_concat_operator' => false, // TODO switch back on when the `src/Console/Application.php` no longer needs the concat
'numeric_literal_separator' => true,
'string_implicit_backslashes' => true, // https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7786
])
->setFinder(
(new Finder())
Expand Down
5 changes: 1 addition & 4 deletions doc/ruleSets/PhpCsFixer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ Rules
- `self_static_accessor <./../rules/class_notation/self_static_accessor.rst>`_
- `single_line_comment_style <./../rules/comment/single_line_comment_style.rst>`_
- `single_line_empty_body <./../rules/basic/single_line_empty_body.rst>`_
- `string_implicit_backslashes <./../rules/string_notation/string_implicit_backslashes.rst>`_ with config:

``['single_quoted' => 'ignore']``

- `string_implicit_backslashes <./../rules/string_notation/string_implicit_backslashes.rst>`_
- `whitespace_after_comma_in_array <./../rules/array_notation/whitespace_after_comma_in_array.rst>`_ with config:

``['ensure_single_space' => true]``
Expand Down
5 changes: 1 addition & 4 deletions doc/rules/string_notation/string_implicit_backslashes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,7 @@ Rule sets

The rule is part of the following rule set:

- `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ with config:

``['single_quoted' => 'ignore']``

- `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_

References
----------
Expand Down
2 changes: 1 addition & 1 deletion src/RuleSet/Sets/PhpCsFixerSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function getRules(): array
'single_line_comment_style' => true,
'single_line_empty_body' => true,
'single_line_throw' => false,
'string_implicit_backslashes' => ['single_quoted' => 'ignore'],
'string_implicit_backslashes' => true,

Check warning on line 122 in src/RuleSet/Sets/PhpCsFixerSet.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 mutation tests

Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ { public function getRules() : array { - return ['@PER-CS' => true, '@symfony' => true, 'blank_line_before_statement' => ['statements' => ['break', 'case', 'continue', 'declare', 'default', 'exit', 'goto', 'include', 'include_once', 'phpdoc', 'require', 'require_once', 'return', 'switch', 'throw', 'try', 'yield', 'yield_from']], 'combine_consecutive_issets' => true, 'combine_consecutive_unsets' => true, 'empty_loop_body' => true, 'explicit_indirect_variable' => true, 'explicit_string_variable' => true, 'fully_qualified_strict_types' => ['import_symbols' => true], 'heredoc_to_nowdoc' => true, 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], 'method_chaining_indentation' => true, 'multiline_comment_opening_closing' => true, 'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'], 'no_extra_blank_lines' => ['tokens' => ['attribute', 'break', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'return', 'square_brace_block', 'switch', 'throw', 'use']], 'no_superfluous_elseif' => true, 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'remove_inheritdoc' => true], 'no_unneeded_control_parentheses' => ['statements' => ['break', 'clone', 'continue', 'echo_print', 'negative_instanceof', 'others', 'return', 'switch_case', 'yield', 'yield_from']], 'no_useless_else' => true, 'no_useless_return' => true, 'no_whitespace_before_comma_in_array' => ['after_heredoc' => true], 'ordered_class_elements' => true, 'ordered_types' => true, 'php_unit_internal_class' => true, 'php_unit_test_class_requires_covers' => true, 'phpdoc_add_missing_param_annotation' => true, 'phpdoc_no_empty_return' => true, 'phpdoc_order_by_value' => true, 'phpdoc_types_order' => true, 'phpdoc_var_annotation_correct_order' => true, 'protected_to_private' => true, 'return_assignment' => true, 'self_static_accessor' => true, 'single_line_comment_style' => true, 'single_line_empty_body' => true, 'single_line_throw' => false, 'string_implicit_backslashes' => true, 'whitespace_after_comma_in_array' => ['ensure_single_space' => true]]; + return ['@PER-CS' => true, '@symfony' => true, 'blank_line_before_statement' => ['statements' => ['break', 'case', 'continue', 'declare', 'default', 'exit', 'goto', 'include', 'include_once', 'phpdoc', 'require', 'require_once', 'return', 'switch', 'throw', 'try', 'yield', 'yield_from']], 'combine_consecutive_issets' => true, 'combine_consecutive_unsets' => true, 'empty_loop_body' => true, 'explicit_indirect_variable' => true, 'explicit_string_variable' => true, 'fully_qualified_strict_types' => ['import_symbols' => true], 'heredoc_to_nowdoc' => true, 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], 'method_chaining_indentation' => true, 'multiline_comment_opening_closing' => true, 'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'], 'no_extra_blank_lines' => ['tokens' => ['attribute', 'break', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'return', 'square_brace_block', 'switch', 'throw', 'use']], 'no_superfluous_elseif' => true, 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'remove_inheritdoc' => true], 'no_unneeded_control_parentheses' => ['statements' => ['break', 'clone', 'continue', 'echo_print', 'negative_instanceof', 'others', 'return', 'switch_case', 'yield', 'yield_from']], 'no_useless_else' => true, 'no_useless_return' => true, 'no_whitespace_before_comma_in_array' => ['after_heredoc' => true], 'ordered_class_elements' => true, 'ordered_types' => true, 'php_unit_internal_class' => true, 'php_unit_test_class_requires_covers' => true, 'phpdoc_add_missing_param_annotation' => true, 'phpdoc_no_empty_return' => true, 'phpdoc_order_by_value' => true, 'phpdoc_types_order' => true, 'phpdoc_var_annotation_correct_order' => true, 'protected_to_private' => true, 'return_assignment' => true, 'self_static_accessor' => true, 'single_line_commen
'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
];
}
Expand Down

0 comments on commit cd21ad8

Please sign in to comment.