<?php
{{#apiInfo}}/**
 * {{appName}}
 * @version {{appVersion}}
 */

require_once __DIR__ . '/vendor/autoload.php';

$app = new Slim\App();

{{#apis}}{{#operations}}{{#operation}}
/**
 * {{httpMethod}} {{nickname}}
 * Summary: {{summary}}
 * Notes: {{notes}}
{{#hasProduces}} * Output-Formats: [{{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}}
 */
$app->{{httpMethod}}('{{path}}', function($request, $response, $args) {
            {{#hasHeaderParams}}$headers = $request->getHeaders();{{/hasHeaderParams}}
            {{#hasQueryParams}}$queryParams = $request->getQueryParams();
            {{#queryParams}}${{paramName}} = $queryParams['{{paramName}}'];{{newline}}    {{/queryParams}}{{/hasQueryParams}}
            {{#hasFormParams}}{{#formParams}}${{paramName}} = $args['{{paramName}}'];{{newline}}    {{/formParams}}{{/hasFormParams}}
            {{#hasBodyParam}}$body = $request->getParsedBody();{{/hasBodyParam}}
            $response->write('How about implementing {{nickname}} as a {{httpMethod}} method ?');
            return $response;
            });

{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}

$app->run();
