1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-29 20:28:59 +01:00

Look at interface namespaces as well

This commit is contained in:
Matthew Brown 2016-01-16 13:07:30 -05:00
parent 083840359a
commit b862073514

View File

@ -72,6 +72,15 @@ class FileChecker
$this->_checkClass($stmt, $this->_namespace, $this->_aliased_classes);
}
}
if ($stmt instanceof PhpParser\Node\Stmt\Interface_) {
if ($namespace->name === null) {
throw new CodeException('Empty namespace', $this->_file_name, $stmt->getLine());
}
$this->_namespace = implode('\\', $namespace->name->parts);
// @todo check interface
}
else if ($stmt instanceof PhpParser\Node\Stmt\Use_) {
foreach ($stmt->uses as $use) {
$this->_aliased_classes[$use->alias] = implode('\\', $use->name->parts);