Skip to content

Commit 1ef5c55

Browse files
committed
cs
1 parent 9df2bf1 commit 1ef5c55

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Tasks.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public static function invalidDoubleQuotedStringChecker(string $contents, Result
116116
if (($token[0] === T_ENCAPSED_AND_WHITESPACE && ($prev[0] !== T_START_HEREDOC || !strpos($prev[1], "'")))
117117
|| ($token[0] === T_CONSTANT_ENCAPSED_STRING && $token[1][0] === '"')
118118
) {
119-
$m = Strings::match($token[1], '#^([^\\\\]|\\\\[\\\\nrtvefxu0-7\W])*+#'); // more strict: '#^([^\\\\]|\\\\[\\\\nrtvefu$"x0-7])*+#'
119+
$m = Strings::match($token[1], '#^([^\\\]|\\\[\\\nrtvefxu0-7\W])*+#'); // more strict: '#^([^\\\\]|\\\\[\\\\nrtvefu$"x0-7])*+#'
120120
if ($token[1] !== $m[0]) {
121121
$result->warning('Invalid escape sequence ' . substr($token[1], strlen($m[0]), 2) . ' in double quoted string', $token[2]);
122122
}
@@ -133,7 +133,7 @@ public static function docSyntaxtHinter(string $contents, Result $result): void
133133
if (($token[0] === T_ENCAPSED_AND_WHITESPACE && $prev[0] !== T_START_HEREDOC
134134
|| $token[0] === T_CONSTANT_ENCAPSED_STRING)
135135
&& str_contains($token[1], "\n")
136-
&& (str_contains($token[1], "\\'") || str_contains($token[1], '\\"'))
136+
&& (str_contains($token[1], "\\'") || str_contains($token[1], '\"'))
137137
) {
138138
$result->warning('Tip: use NOWDOC or HEREDOC', $token[2]);
139139
}

tests/Tasks.invalidDoubleQuotedStringChecker.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ test(function () {
1818
test(function () {
1919
$result = new Result;
2020
Tasks::invalidDoubleQuotedStringChecker('<?php $a = "\X10"', $result);
21-
Assert::same([[Result::Warning, 'Invalid escape sequence \\X in double quoted string', 1]], $result->getMessages());
21+
Assert::same([[Result::Warning, 'Invalid escape sequence \X in double quoted string', 1]], $result->getMessages());
2222
});

0 commit comments

Comments
 (0)