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