1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Remove Vimeo-specific code and improve class checking

This commit is contained in:
Matthew Brown 2016-04-16 11:28:19 -04:00
parent 14b6b3dae2
commit f4910b0b96
2 changed files with 4 additions and 5 deletions

View File

@ -90,10 +90,6 @@ class ClassChecker implements StatementsSource
throw new \InvalidArgumentException('$class cannot be empty');
}
if (strpos($file_name, 'hoodahoop')) {
return;
}
$absolute_class = preg_replace('/^\\\/', '', $absolute_class);
if (isset(self::$_existing_classes[$absolute_class])) {
@ -104,7 +100,7 @@ class ClassChecker implements StatementsSource
throw new CodeException('Class ' . $absolute_class . ' does not exist', $file_name, $stmt->getLine());
}
if (class_exists($absolute_class, true) && (strpos($absolute_class, 'Vimeo') === 0 || strpos($absolute_class, '\\') === false)) {
if (class_exists($absolute_class, true) && strpos($absolute_class, '\\') === false) {
$reflection_class = new \ReflectionClass($absolute_class);
if ($reflection_class->getName() !== $absolute_class) {

View File

@ -1306,6 +1306,8 @@ class StatementsChecker
}
if ($absolute_class && $absolute_class[0] === strtoupper($absolute_class[0]) && !method_exists($absolute_class, '__call') && !self::_isMock($absolute_class)) {
ClassChecker::checkAbsoluteClass($absolute_class, $stmt, $this->_file_name);
$method_id = $absolute_class . '::' . $stmt->name;
if (!isset(self::$_method_call_index[$method_id])) {
@ -1599,6 +1601,7 @@ class StatementsChecker
$absolute_class = $this->_absolute_class;
} else {
$absolute_class = ClassChecker::getAbsoluteClassFromName($stmt->class, $this->_namespace, $this->_aliased_classes);
ClassChecker::checkAbsoluteClass($absolute_class, $stmt, $this->_file_name);
}
$const_id = $absolute_class . '::' . $stmt->name;