Skip check if CONSTANT on real object is used

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2019-04-01 14:31:29 +02:00
parent f345785865
commit 23d7fdeef0
No known key found for this signature in database
GPG key ID: 36E3664E099D0614

View file

@ -162,7 +162,7 @@ class NodeVisitor extends NodeVisitorAbstract {
if ($node->class instanceof Name) {
$this->checkBlackList($node->class->toString(), CodeChecker::CLASS_CONST_FETCH_NOT_ALLOWED, $node);
}
if ($node->class instanceof Node\Expr\Variable) {
if ($node->class instanceof Node\Expr\Variable || $node->class instanceof Node\Expr\PropertyFetch) {
/**
* TODO: find a way to detect something like this:
* $c = "OC_API";