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:
parent
22b6dafe3c
commit
c5952af6f0
@ -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;
|
||||
|
@ -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;
|
||||
}',
|
||||
|
Loading…
x
Reference in New Issue
Block a user