1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Use a blacklist, not a whitelist

This commit is contained in:
Matthew Brown 2017-09-16 13:28:33 -04:00
parent 3a8efec728
commit 391696bc83

View File

@ -1704,8 +1704,12 @@ class CallChecker
if ($function_param
&& $function_param->by_ref
&& !($arg->value instanceof PhpParser\Node\Expr\Variable)
&& !($arg->value instanceof PhpParser\Node\Expr\PropertyFetch)
&& ($arg->value instanceof PhpParser\Node\Scalar
|| $arg->value instanceof PhpParser\Node\Expr\ClassConstFetch
|| $arg->value instanceof PhpParser\Node\Expr\ConstFetch
|| $arg->value instanceof PhpParser\Node\Expr\FuncCall
|| $arg->value instanceof PhpParser\Node\Expr\MethodCall
)
) {
if (IssueBuffer::accepts(
new InvalidPassByReference(