php-mezzio-ph-modern.api.mustache Maven / Gradle / Ivy
{{internal.ze-ph.queryDataType}}::class,
"objectAttr" => "queryData",
"source" => PHAttribute\Transfer::SOURCE_GET
])]
{{/internal.ze-ph.hasQueryData}}
{{/vendorExtensions}}
{{#bodyParam}}
{{#consumes}}
// TODO check if consumer is valid, if it has correct priority and if it can be moved to class annotation
#[PHA\Consumer("{{{mediaType}}}", PHConsumer\Json::class)]
{{/consumes}}
{{^isPrimitiveType}}
#[PHA\Attribute(PHAttribute\Transfer::class, ["type" => {{dataType}}::class, "objectAttr" => "bodyData"])]
{{/isPrimitiveType}}
{{/bodyParam}}
{{#produces}}
// TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
#[PHA\Producer("{{{mediaType}}}", PHProducer\Transfer::class)]
{{/produces}}
public function {{operationId}}(ServerRequestInterface $request){{#returnType}}: {{.}}{{/returnType}}
{
//TODO implement method
{{#vendorExtensions}}
{{#internal.ze-ph.hasQueryData}}
/** @var {{internal.ze-ph.queryDataType}} $queryData */
$queryData = $request->getAttribute("queryData");
{{/internal.ze-ph.hasQueryData}}
{{/vendorExtensions}}
{{#bodyParam}}
{{^isPrimitiveType}}
/** @var {{dataType}} $bodyData */
$bodyData = $request->getAttribute("bodyData");
{{/isPrimitiveType}}
{{/bodyParam}}
throw new PHException\HttpCode(501, "Not implemented");
}
{{/operation}}
}
{{/operations}}