1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-23 14:00:55 +01:00

Replace preg_quote() lint error by warning

Summary: See http://php.net/regexp.reference.delimiters

Test Plan: arc lint on a file with preg_quote() with one parameter

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley, vrana

Differential Revision: https://secure.phabricator.com/D1163
This commit is contained in:
Jakub Vrana 2011-12-02 16:55:02 -08:00 committed by vrana
parent 6910fd77a4
commit 7af16f42cd
2 changed files with 7 additions and 4 deletions

View file

@ -91,6 +91,8 @@ class ArcanistXHPASTLinter extends ArcanistLinter {
=> ArcanistLintSeverity::SEVERITY_WARNING,
self::LINT_NAMING_CONVENTIONS
=> ArcanistLintSeverity::SEVERITY_WARNING,
self::LINT_PREG_QUOTE_MISUSE
=> ArcanistLintSeverity::SEVERITY_WARNING,
);
}
@ -1054,8 +1056,9 @@ class ArcanistXHPASTLinter extends ArcanistLinter {
/**
* preg_quote() takes two arguments, but the second one is optional because
* PHP is awesome. If you don't pass a second argument, you're probably
* going to get something wrong.
* it is possible to use (), [] or {} as regular expression delimiters. If
* you don't pass a second argument, you're probably going to get something
* wrong.
*/
protected function lintPregQuote($root) {
$function_calls = $root->selectDescendantsOfType('n_FUNCTION_CALL');

View file

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