From 200ea70334bb5bd825db804a97c9681d0cdd0af6 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sat, 21 Jul 2018 20:50:42 -0400 Subject: [PATCH] Check that non-user-defined abstract methods are implemented, too --- src/Psalm/Codebase/Reflection.php | 2 ++ tests/ClassTest.php | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Psalm/Codebase/Reflection.php b/src/Psalm/Codebase/Reflection.php index d12601de7..5d188fb67 100644 --- a/src/Psalm/Codebase/Reflection.php +++ b/src/Psalm/Codebase/Reflection.php @@ -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()); diff --git a/tests/ClassTest.php b/tests/ClassTest.php index 76868b5c1..a3838edbe 100644 --- a/tests/ClassTest.php +++ b/tests/ClassTest.php @@ -447,11 +447,20 @@ class ClassTest extends TestCase ], 'abstractClassMethod' => [ ' 'UnimplementedAbstractMethod', + ], + 'abstractReflectedClassMethod' => [ + ' 'UnimplementedAbstractMethod', ], 'missingParent' => [