@param ClientMethodContext $context

@return DocBlockGenerator
550727
private function generateSingleArgumentDocblock(ClientMethodContext $context): DocBlockGenerator
    {
        $method = $context->getMethod();
        $class = $context->getClass();
        $param = current($method->getParameters());

        return DocBlockGeneratorFactory::fromArray(
            [
                'tags' => [
                    [
                        'name' => 'param',
                        'description' => sprintf(
                            '%s|%s $%s',
                            $this->generateClassNameAndAddImport(RequestInterface::class, $class),
                            $this->generateClassNameAndAddImport($param->getType(), $class, true),
                            $param->getName()
                        ),
                    ],
                    [
                        'name' => 'return',
                        'description' => sprintf(
                            '%s|%s',
                            $this->generateClassNameAndAddImport(ResultInterface::class, $class),
                            $this->generateClassNameAndAddImport(
                                $method->getNamespacedReturnType(),
                                $class,
                                true
                            )
                        ),

                    ],
                    [
                        'name' => 'throws',
                        'description' => $this->generateClassNameAndAddImport(
                            SoapException::class,
                            $class
                        ),
                    ],
                ],
            ]
        )->setWordWrap(false);
    }
153019
public function createNewFromParent(Context $context, $parent)
    {
        $resource = $this->createNew($context);
        $resource->setParent($parent);
        return $resource;
    }
750528
public function parse($comment, ParserContext $context)
    {
        $docBlock = null;
        $errorMessage = '';

        try {
            $docBlockContext = new DocBlock\Context($context->getNamespace(), $context->getAliases() ?: array());
            $docBlock = new DocBlock((string) $comment, $docBlockContext);
        } catch (\Exception $e) {
            $errorMessage = $e->getMessage();
        }

        $result = new DocBlockNode();

        if ($errorMessage) {
            $result->addError($errorMessage);

            return $result;
        }

        $result->setShortDesc($docBlock->getShortDescription());
        $result->setLongDesc((string) $docBlock->getLongDescription());

        foreach ($docBlock->getTags() as $tag) {
            $result->addTag($tag->getName(), $this->parseTag($tag));
        }

        return $result;
    }
373419
public function render($context)
    {
        if (count($this->class) > 0 && is_array($this->class)) {
            foreach ($this->class as $class) {
                $this->getCell()->addClass($class);
            }
        }
        return $context;
    }
1035835
public void generate(Context context) {
        Appendable target = context.getTarget();

        for (ProcTemplateElement element : elements) {
            try {
                target.append(element.generate(context));
            } catch (IOException e) {
                // Nothing! Because StringBuilder doesn't catch IOException
            }
        }
    }
393654
public function render($context)
    {
        if (count($this->class) > 0) {
            foreach ($this->class as $class) {
                $this->getRow()->addClass($class);
            }
        }
        return $context;
    }
973900
private function createParamsFromContext(ClientMethodContext $context): ParameterGenerator
    {
        if (!$context->isMultiArgument()) {
            $param = current($context->getMethod()->getParameters());

            return ParameterGenerator::fromArray($param->toArray());
        }

        return ParameterGenerator::fromArray(
            [
                'name' => 'multiArgumentRequest',
                'type' => MultiArgumentRequest::class,
            ]
        );
    }
809839
public function create($context = null)
    {
        try {
            $this->context = strlen($context) ? $context : $this->getConfig('create[context]', self::CONTEXT_CREATE);
            $this->controller->pageTitle = $this->controller->pageTitle ?: $this->getLang(
                "{$this->context}[title]",
                'backend::lang.form.create_title'
            );

            $model = $this->controller->formCreateModelObject();
            $model = $this->controller->formExtendModel($model) ?: $model;

            $this->initForm($model);
        }
        catch (Exception $ex) {
            $this->controller->handleError($ex);
        }
    }
498171
protected static function construct(ExecutionContext $exeContext = null): Executor
    {
        $executorReflection = new \ReflectionClass(Executor::class);
        /** @var Executor $executor */
        $executor = $executorReflection->newInstanceWithoutConstructor();

        if ($exeContext !== null) {
            $constructor = $executorReflection->getConstructor();
            $constructor->setAccessible(true);
            $constructor->invoke($executor, $exeContext);
        }

        return $executor;
    }
309269
private function createDocblockForMethod(
    $requestMethod,
    $action,
    $getParams,
    $postParams
  )
  {
    if (empty($action->doc))
    {
      $action->doc = 'TODO';
    }

    /*
     * $action->doc
     * METHOD: /{url:[a-z]+}
     */
    $docblock = new DocBlockGenerator(
      $action->doc,
      strtoupper($requestMethod) . ': ' . $action->url
    );

    foreach ($getParams as $param)
    {
      //@param $paramName
      $docblock->setTag(new GenericTag('param', "\${$param->getName()}"));
    }

    foreach ($postParams as $postParam)
    {
      //@postParam('paramName')
      $docblock->setTag(new GenericTag('postParam', "('{$postParam->getName()}')"));
    }

    if (!empty($action->throws))
    {
      //@throws \Name\Space\Version\Exceptions\EntityName\SomethingException
      $docblock->setTag(
        new GenericTag(
          'throws',
          sprintf(
            "\\%s\\%s\\Exceptions\\%s\\%s",
            Generator::$namespace,
            $this->version,
            $this->entityName,
            $action->throws->exception
          )
        )
      );
    }

    if (!empty($action->returns))
    {
      //@returns \Name\Space\Version\EntityName\EntityName(s)?Response
      $docblock->setTag(
        new GenericTag(
          'returns',
          sprintf(
            "\\%s\\%s\\Responses\\%s\\%s",
            Generator::$namespace,
            $this->version,
            $this->entityName,
            $action->returns
          )
        )
      );
    }

    return $docblock;
  }
26606
public function getContext(ViewContextInterface $context = null)
    {
        $context = new ViewContext($context);
        $context->setEntity($this->getModel()->fetch());
        $context->setData($this->getData());
        $context->setParameters($this->getParameters());

        return $context;
    }
791866
public function setContext(RequestContext $context)
    {
        if (null !== $this->generator) {
            $this->getGenerator()->setContext($context);
        }
        $this->context = $context;
    }
777373
protected function _actionRender(TemplateContext $context)
    {
        $source = parent::render($context->source, ObjectConfig::unbox($context->data));

        if($context->type && !in_array($context->type, $this->_excluded_types))
        {
            $source = $this->getObject('template.engine.factory')
                ->createEngine($context->type, array('functions' => $this->getFunctions()))
                ->render($source, $this->getData());
        }

        return $source;
    }
1329197
public function getSeoPageContext($context)
    {
        if (isset($this->seoPagesContext[$context])) {
            return $this->seoPagesContext[$context];
        }
        $contextTemplate = $this->findOneBy(['context' => $context]);

        if ($contextTemplate) {
            $this->seoPagesContext[$context] = $contextTemplate;

            return $this->seoPagesContext[$context];
        }

        return null;
    }
476765
protected function _actionBlock(AnCommandContext $context)
    {
        $this->getResponse()->status = AnHttpResponse::RESET_CONTENT;
        $this->getItem()->addBlocker($this->actor);

        return $this->getItem();
    }
823128
private function configureContext(Context $context)
    {
        foreach ($this->attributes as $key => $value) {
            $context->setAttribute($key, $value);
        }
        if (!empty($this->groups)) {
            $context->setGroups($this->groups);
        }

        if (($context instanceof SerializationContext) && $this->serializeNulls !== null) {
            $context->setSerializeNull($this->serializeNulls);
        }

        if ($this->enableMaxDepthChecks === true) {
            $context->enableMaxDepthChecks();
        }

        if ($this->version !== null) {
            $context->setVersion($this->version);
        }

        return $context;
    }
1188023
public function setContext($context)
    {
        if (!is_array($context) && !$context instanceof \ArrayObject && !$context instanceof \Iterator) {
            throw new EventException('Unexpected value type for context', EventException::INVALID_CONTEXT);
        }

        $context = Collection::cast($context);

        $this->context = $context;

        return $this;
    }