/** * {@inheritdoc} */ public function process($context, Result $result, Collection $collection) { $model = $context->getAnnotation()->toModel(); if ($operation = $result->getCurrent('operation')) { $operation->addResponse($model); } $result->set('response', $model->getCode(), $model); }
/** * {@inheritdoc} */ public function process($context, Result $result, Collection $collection) { $model = $context->getAnnotation()->toModel(); if ($api = $result->getCurrent('api')) { $api->addResource($model); } $result->set('resource', $model->getId(), $model); }
/** * {@inheritdoc} */ public function process($context, Result $result, Collection $collection) { $model = $context->getAnnotation()->toModel(); if ($operation = $result->getCurrent('operation')) { $operation->addParameter($model); } $result->set('parameter', $model->getId(), $model); }
/** * {@inheritdoc} */ public function process($context, Result $result, Collection $collection) { $model = $context->getAnnotation()->toModel(); if ($model->getId() === null && $context->getContext() instanceof PHPFunction) { $model->setId($context->getContext()->getFunction()); } if ($resource = $result->getCurrent('resource')) { $resource->addOperation($model); } $result->set('operation', $model->getId(), $model); }
/** * {@inheritdoc} */ public function process($context, Result $result, Collection $collection) { $model = $context->getAnnotation()->toModel(); $result->set('api', $model->getId(), $model); }