Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/xhpast/rules/ArcanistDoubleQuoteXHPASTLinterRule.php
Context not available. | |||||
foreach ($strings as $string) { | foreach ($strings as $string) { | ||||
$concrete_string = $string->getConcreteString(); | $concrete_string = $string->getConcreteString(); | ||||
$single_quoted = ($concrete_string[0] === "'"); | $single_quoted = ($concrete_string[0] === "'"); | ||||
$contents = substr($concrete_string, 1, -1); | $contents = @substr($concrete_string, 1, -1); | ||||
// Double quoted strings are allowed when the string contains the | // Double quoted strings are allowed when the string contains the | ||||
// following characters. | // following characters. | ||||
Context not available. | |||||
$contains_special_chars = false; | $contains_special_chars = false; | ||||
foreach ($allowed_chars as $allowed_char) { | foreach ($allowed_chars as $allowed_char) { | ||||
if (strpos($contents, $allowed_char) !== false) { | if (@strpos($contents, $allowed_char) !== false) { | ||||
$contains_special_chars = true; | $contains_special_chars = true; | ||||
} | } | ||||
} | } | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0