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:
parent
3a8efec728
commit
391696bc83
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user