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

Fix bug with trait implementing abstract method

This commit is contained in:
Matthew Brown 2017-07-28 23:38:57 -04:00
parent 22b6dafe3c
commit c5952af6f0
2 changed files with 24 additions and 1 deletions

View File

@ -705,7 +705,16 @@ class ProjectChecker
}
if (isset($storage->declaring_method_ids[$aliased_method_name])) {
continue;
list($implementing_fq_class_name) = explode(
'::',
$storage->declaring_method_ids[$aliased_method_name]
);
$implementing_class_storage = ClassLikeChecker::$storage[strtolower($implementing_fq_class_name)];
if (!$implementing_class_storage->abstract) {
continue;
}
}
$parent_method_id = $parent_class . '::' . $method_name;

View File

@ -294,6 +294,20 @@ class TraitTest extends TestCase
public function foo() : void {}
}
class B extends A {
use T;
}',
],
'useTraitInSubclassWithAbstractMethodInParent' => [
'<?php
trait T {
public function foo() : void {}
}
abstract class A {
abstract public function foo() : void {}
}
class B extends A {
use T;
}',