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

Check that non-user-defined abstract methods are implemented, too

This commit is contained in:
Matthew Brown 2018-07-21 20:50:42 -04:00
parent bc23f732a4
commit 200ea70334
2 changed files with 15 additions and 4 deletions

View File

@ -235,6 +235,8 @@ class Reflection
$declaring_class = $method->getDeclaringClass();
$storage->is_static = $method->isStatic();
$storage->abstract = $method->isAbstract();
$class_storage->declaring_method_ids[$method_name] =
$declaring_class->name . '::' . strtolower((string)$method->getName());

View File

@ -447,11 +447,20 @@ class ClassTest extends TestCase
],
'abstractClassMethod' => [
'<?php
abstract class A {
abstract public function foo();
}
abstract class A {
abstract public function foo();
}
class B extends A { }',
class B extends A { }',
'error_message' => 'UnimplementedAbstractMethod',
],
'abstractReflectedClassMethod' => [
'<?php
class DedupeIterator extends FilterIterator {
public function __construct(Iterator $i) {
parent::__construct($i);
}
}',
'error_message' => 'UnimplementedAbstractMethod',
],
'missingParent' => [