Skip to content

Commit

Permalink
relaxplus: Add string_implicit_backslashes
Browse files Browse the repository at this point in the history
  • Loading branch information
realodix committed Jul 30, 2024
1 parent fbfadcd commit ac955b4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/RuleSet/Sets/RelaxPlus.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function mainRules(): array
'explicit_string_variable' => true,
'no_superfluous_elseif' => true,
'php_unit_method_casing' => true,
'string_implicit_backslashes' => true,
'general_phpdoc_annotation_remove' => [
'annotations' => [
// https://github.com/doctrine/coding-standard/blob/3e88327/lib/Doctrine/ruleset.xml#L227
Expand Down
9 changes: 9 additions & 0 deletions tests/Fixtures/Ruleset/relaxplus_actual.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ public function string_notation__explicit_string_variable()
echo "My name is $name !";
}

public function string_notation__string_implicit_backslashes()
{
$singleQuoted = 'String with \\" and My\Prefix\\';
$doubleQuoted = "Interpret my \n but not my \a";
$hereDoc = <<<HEREDOC
Interpret my \100 but not my \999
HEREDOC;
}

public function customFixer__NoDoctrineMigrationsGeneratedCommentFixer()
{
// this up() migration is auto-generated, please modify it to your needs
Expand Down
9 changes: 9 additions & 0 deletions tests/Fixtures/Ruleset/relaxplus_expected.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ public function string_notation__explicit_string_variable()
echo "My name is {$name} !";
}

public function string_notation__string_implicit_backslashes()
{
$singleQuoted = 'String with \" and My\Prefix\\';
$doubleQuoted = "Interpret my \n but not my \\a";
$hereDoc = <<<HEREDOC
Interpret my \100 but not my \\999
HEREDOC;
}

public function customFixer__NoDoctrineMigrationsGeneratedCommentFixer()
{
$this->addSql('UPDATE t1 SET col1 = col1 + 1');
Expand Down

0 comments on commit ac955b4

Please sign in to comment.