From de4eba707762f8b9fce05b968fc5ba2d256bd16d Mon Sep 17 00:00:00 2001 From: Jeremiah VALERIE Date: Mon, 25 Apr 2016 11:56:10 +0200 Subject: [PATCH] Fix interface implementaion when interface is extends. --- src/Type/Definition/InterfaceType.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Type/Definition/InterfaceType.php b/src/Type/Definition/InterfaceType.php index 7bf37c5..dd5a6e2 100644 --- a/src/Type/Definition/InterfaceType.php +++ b/src/Type/Definition/InterfaceType.php @@ -49,8 +49,9 @@ class InterfaceType extends Type implements AbstractType, OutputType, CompositeT public static function addImplementationToInterfaces(ObjectType $impl) { self::$_lazyLoadImplementations[] = function() use ($impl) { + /** @var self $interface */ foreach ($impl->getInterfaces() as $interface) { - $interface->_implementations[] = $impl; + $interface->addImplementation($impl); } }; } @@ -66,6 +67,16 @@ class InterfaceType extends Type implements AbstractType, OutputType, CompositeT self::$_lazyLoadImplementations = []; } + /** + * Add a implemented object type to interface + * + * @param ObjectType $impl + */ + protected function addImplementation(ObjectType $impl) + { + $this->_implementations[] = $impl; + } + /** * InterfaceType constructor. * @param array $config