From 7f210b051de95a1d79bc0f24f7ce721c69815794 Mon Sep 17 00:00:00 2001 From: Daniel Kurowski <daniel.kurowski@grifart.cz> Date: Tue, 19 Jan 2021 16:21:28 +0100 Subject: [PATCH] KeepMethodDecorator: import FQN of interfaces as well --- src/Decorators/KeepMethodDecorator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Decorators/KeepMethodDecorator.php b/src/Decorators/KeepMethodDecorator.php index a3584b7..a27d1e2 100644 --- a/src/Decorators/KeepMethodDecorator.php +++ b/src/Decorators/KeepMethodDecorator.php @@ -79,7 +79,7 @@ final class KeepMethodDecorator implements ClassDecorator */ foreach ($method->getParameters() as $parameter) { $type = $parameter->getType(); - if ($type !== null && \class_exists($type)) { + if ($type !== null && (\class_exists($type) || \interface_exists($type))) { $namespace->addUse($type); } } -- GitLab