/**
* @param ContextInterface $context
* @param ClassGenerator $class
* @param Property $property
*
* @throws \Zend\Code\Generator\Exception\InvalidArgumentException
*/
private function implementGetResult(ContextInterface $context, ClassGenerator $class, Property $property)
{
$useAssembler = new UseAssembler($this->wrapperClass ?: ResultInterface::class);
if ($useAssembler->canAssemble($context)) {
$useAssembler->assemble($context);
}
$methodName = 'getResult';
$class->removeMethod($methodName);
$class->addMethodFromGenerator(MethodGenerator::fromArray(['name' => $methodName, 'parameters' => [], 'visibility' => MethodGenerator::VISIBILITY_PUBLIC, 'body' => $this->generateGetResultBody($property), 'docblock' => DocBlockGenerator::fromArray(['tags' => [['name' => 'return', 'description' => $this->generateGetResultReturnTag($property)]]])]));
}