mirror of
https://github.com/danog/psalm.git
synced 2024-12-02 09:37:59 +01:00
Check that non-user-defined abstract methods are implemented, too
This commit is contained in:
parent
bc23f732a4
commit
200ea70334
@ -235,6 +235,8 @@ class Reflection
|
|||||||
$declaring_class = $method->getDeclaringClass();
|
$declaring_class = $method->getDeclaringClass();
|
||||||
|
|
||||||
$storage->is_static = $method->isStatic();
|
$storage->is_static = $method->isStatic();
|
||||||
|
$storage->abstract = $method->isAbstract();
|
||||||
|
|
||||||
$class_storage->declaring_method_ids[$method_name] =
|
$class_storage->declaring_method_ids[$method_name] =
|
||||||
$declaring_class->name . '::' . strtolower((string)$method->getName());
|
$declaring_class->name . '::' . strtolower((string)$method->getName());
|
||||||
|
|
||||||
|
@ -447,11 +447,20 @@ class ClassTest extends TestCase
|
|||||||
],
|
],
|
||||||
'abstractClassMethod' => [
|
'abstractClassMethod' => [
|
||||||
'<?php
|
'<?php
|
||||||
abstract class A {
|
abstract class A {
|
||||||
abstract public function foo();
|
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',
|
'error_message' => 'UnimplementedAbstractMethod',
|
||||||
],
|
],
|
||||||
'missingParent' => [
|
'missingParent' => [
|
||||||
|
Loading…
Reference in New Issue
Block a user