1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Only warn about unimplemented interface methods for non-abstract classes

This commit is contained in:
Matthew Brown 2016-12-28 16:46:30 -05:00
parent 992e7ae256
commit fa1da90fbe

View File

@ -414,7 +414,7 @@ abstract class ClassLikeChecker extends SourceChecker implements StatementsSourc
$config = Config::getInstance();
if ($this instanceof ClassChecker) {
if ($this instanceof ClassChecker && $this->class instanceof PhpParser\Node\Stmt\Class_) {
foreach (ClassChecker::getInterfacesForClass($this->fq_class_name) as $interface_id => $interface_name) {
if (isset(self::$public_class_constants[$interface_name])) {
self::$public_class_constants[$this->fq_class_name] +=
@ -426,7 +426,9 @@ abstract class ClassLikeChecker extends SourceChecker implements StatementsSourc
$implemented_method_id = $this->fq_class_name . '::' . $method_name;
MethodChecker::setOverriddenMethodId($implemented_method_id, $mentioned_method_id);
if (!isset(self::$public_class_methods[$this->fq_class_name][$method_name])) {
if (!isset(self::$public_class_methods[$this->fq_class_name][$method_name]) &&
!$this->class->isAbstract()
) {
$cased_method_id = MethodChecker::getCasedMethodId($mentioned_method_id);
if (IssueBuffer::accepts(