Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13973798
D9196.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
966 B
Referenced Files
None
Subscribers
None
D9196.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D9196: Improve autofixing of double quotes in XHPAST linter.
Attached
Detach File
Event Timeline
Log In to Comment