Page MenuHomePhabricator

D9196.diff
No OneTemporary

D9196.diff

diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php
--- a/src/lint/linter/ArcanistXHPASTLinter.php
+++ b/src/lint/linter/ArcanistXHPASTLinter.php
@@ -2428,7 +2428,7 @@
$valid = true;
} else if (!$contains_special_chars && !$single_quoted) {
$invalid_nodes[] = $string;
- $fixes[$string->getID()] = "'".$contents."'";
+ $fixes[$string->getID()] = "'".str_replace('\"', '"', $contents)."'";
}
}
diff --git a/src/lint/linter/__tests__/xhpast/double-quote.lint-test b/src/lint/linter/__tests__/xhpast/double-quote.lint-test
--- a/src/lint/linter/__tests__/xhpast/double-quote.lint-test
+++ b/src/lint/linter/__tests__/xhpast/double-quote.lint-test
@@ -1,6 +1,6 @@
<?php
'foobar';
-"foobar";
+"foo\"bar";
"foobar\n";
"'foobar'";
"foo{$bar}";
@@ -16,7 +16,7 @@
~~~~~~~~~~
<?php
'foobar';
-'foobar';
+'foo"bar';
"foobar\n";
"'foobar'";
"foo{$bar}";

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 19, 2:46 AM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6729922
Default Alt Text
D9196.diff (966 B)

Event Timeline