mirror of
https://github.com/danog/class-finder.git
synced 2025-01-22 13:51:42 +01:00
Dont identify sub-namespaces (intended for later)
This commit is contained in:
parent
ea97ae9550
commit
2a9d51931a
@ -36,7 +36,13 @@ class FilesEntry
|
||||
$classes = $this->getClassesInFile();
|
||||
|
||||
return array_filter($classes, function($class) use ($namespace) {
|
||||
return strpos($class, $namespace) !== false;
|
||||
$classNameFragments = explode('\\', $class);
|
||||
array_pop($classNameFragments);
|
||||
$classNamespace = implode('\\', $classNameFragments);
|
||||
|
||||
$namespace = trim($namespace, '\\');
|
||||
|
||||
return $namespace === $classNamespace;
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user