public function assemble(ContextInterface $context)
{
$class = $context->getClass();
$properties = $context->getType()->getProperties();
$firstProperty = count($properties) ? current($properties) : null;
try {
$interfaceAssembler = new InterfaceAssembler(\IteratorAggregate::class);
if ($interfaceAssembler->canAssemble($context)) {
$interfaceAssembler->assemble($context);
}
if ($firstProperty) {
$this->implementGetIterator($class, $firstProperty);
}
} catch (\Exception $e) {
throw AssemblerException::fromException($e);
}
}