Skip to content

Commit f30101c

Browse files
committed
ignore built-in functions & constants
1 parent 63ad7fb commit f30101c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

InfinityloopCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesAfterUsageSniff.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,15 @@ public function process(File $phpcsFile, $openTagPointer) : void
130130
}
131131
}
132132

133-
//Skip functions and constants
134-
if ($reference->isFunction || $reference->isConstant) {
133+
if ($reference->isClass === true && !NamespaceHelper::hasNamespace($name) && $isFullyQualified) {
135134
continue;
136135
}
137136

138-
//Ignore stdClass
139-
if ($reference->isClass === true && $canonicalName === 'stdClass') {
137+
if ($reference->isFunction === true && !NamespaceHelper::hasNamespace($name) && $isFullyQualified) {
138+
continue;
139+
}
140+
141+
if ($reference->isConstant === true && !NamespaceHelper::hasNamespace($name) && $isFullyQualified) {
140142
continue;
141143
}
142144

0 commit comments

Comments
 (0)