1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42:41 +01:00

Decrease severity of preg_quote() warning

Summary: I use it more often without second parameter than with it.

Test Plan:
Lint of:

  preg_quote('');
  preg_quote('', '/');

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3647
This commit is contained in:
vrana 2012-10-05 16:32:06 -07:00
parent d0425fc238
commit d0ed67ab1d
2 changed files with 6 additions and 5 deletions

View file

@ -114,7 +114,7 @@ final class ArcanistXHPASTLinter extends ArcanistLinter {
self::LINT_NAMING_CONVENTIONS
=> ArcanistLintSeverity::SEVERITY_WARNING,
self::LINT_PREG_QUOTE_MISUSE
=> ArcanistLintSeverity::SEVERITY_WARNING,
=> ArcanistLintSeverity::SEVERITY_ADVICE,
self::LINT_BRACE_FORMATTING
=> ArcanistLintSeverity::SEVERITY_WARNING,
self::LINT_PARENTHESES_SPACING
@ -1772,8 +1772,9 @@ final class ArcanistXHPASTLinter extends ArcanistLinter {
$this->raiseLintAtNode(
$call,
self::LINT_PREG_QUOTE_MISUSE,
'You should always pass two arguments to preg_quote(), so that ' .
'preg_quote() knows which delimiter to escape.');
'If you use pattern delimiters that require escaping (such as //, '.
'but not ()) then you should pass two arguments to preg_quote(), '.
'so that preg_quote() knows which delimiter to escape.');
}
}
}

View file

@ -8,5 +8,5 @@ function foo($bar) {
}
~~~~~~~~~~
warning:4:3 Wrong number of arguments to preg_quote()
warning:6:3 Wrong number of arguments to preg_quote()
advice:4:3 Wrong number of arguments to preg_quote()
advice:6:3 Wrong number of arguments to preg_quote()