2016-05-16 05:06:03 +02:00
|
|
|
<?php
|
|
|
|
|
2016-08-13 20:20:46 +02:00
|
|
|
namespace Psalm\Checker;
|
2016-05-16 05:06:03 +02:00
|
|
|
|
|
|
|
use PhpParser;
|
|
|
|
|
2016-08-13 20:20:46 +02:00
|
|
|
class InterfaceChecker extends ClassLikeChecker
|
2016-05-16 05:06:03 +02:00
|
|
|
{
|
2016-08-13 20:20:46 +02:00
|
|
|
public function __construct(PhpParser\Node\Stmt\Interface_ $interface, StatementsSource $source)
|
2016-05-16 05:06:03 +02:00
|
|
|
{
|
|
|
|
$this->_class = $class;
|
|
|
|
$this->_namespace = $source->getNamespace();
|
|
|
|
$this->_aliased_classes = $source->getAliasedClasses();
|
|
|
|
$this->_file_name = $source->getFileName();
|
|
|
|
$this->_absolute_class = $absolute_class;
|
|
|
|
|
|
|
|
$this->_parent_class = null;
|
|
|
|
|
2016-08-08 20:36:18 +02:00
|
|
|
$this->_suppressed_issues = $source->getSuppressedIssues();
|
|
|
|
|
2016-05-16 05:06:03 +02:00
|
|
|
self::$_existing_classes[$absolute_class] = 1;
|
2016-08-08 20:36:18 +02:00
|
|
|
|
|
|
|
self::$_class_checkers[$absolute_class] = $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function check($check_methods = true, Context $class_context = null)
|
|
|
|
{
|
2016-08-13 20:20:46 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function interfaceExists($absolute_class)
|
|
|
|
{
|
|
|
|
if (isset(self::$_existing_interfaces_ci[strtolower($absolute_class)])) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (interface_exists($absolute_class, true)) {
|
|
|
|
self::$_existing_interfaces_ci[strtolower($absolute_class)] = true;
|
|
|
|
return true;
|
2016-05-16 05:06:03 +02:00
|
|
|
}
|
2016-08-08 20:36:18 +02:00
|
|
|
|
2016-08-13 20:20:46 +02:00
|
|
|
return false;
|
2016-05-16 05:06:03 +02:00
|
|
|
}
|
|
|
|
}
|