Fix interface implementaion when interface is extends.

This commit is contained in:
Jeremiah VALERIE 2016-04-25 11:56:10 +02:00
parent 327cc52601
commit de4eba7077

View File

@ -49,8 +49,9 @@ class InterfaceType extends Type implements AbstractType, OutputType, CompositeT
public static function addImplementationToInterfaces(ObjectType $impl) public static function addImplementationToInterfaces(ObjectType $impl)
{ {
self::$_lazyLoadImplementations[] = function() use ($impl) { self::$_lazyLoadImplementations[] = function() use ($impl) {
/** @var self $interface */
foreach ($impl->getInterfaces() as $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 = []; self::$_lazyLoadImplementations = [];
} }
/**
* Add a implemented object type to interface
*
* @param ObjectType $impl
*/
protected function addImplementation(ObjectType $impl)
{
$this->_implementations[] = $impl;
}
/** /**
* InterfaceType constructor. * InterfaceType constructor.
* @param array $config * @param array $config