Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
19 | 12 | public function __invoke(Application $app, Request $request) |
|
20 | { |
||
21 | $options = array( |
||
22 | 12 | "output" => "json", |
|
23 | 12 | "json_pretty_print" => $app["swagger.prettyPrint"], |
|
24 | 12 | 'basePath' => $app["swagger.basePath"], |
|
25 | 12 | "prefix" => $app["swagger.resourcePrefix"], |
|
26 | 12 | "suffix" => $app["swagger.resourceSuffix"], |
|
27 | 12 | "apiVersion" => $app["swagger.apiVersion"], |
|
28 | 12 | "swaggerVersion" => $app["swagger.swaggerVersion"], |
|
29 | ); |
||
30 | 12 | $json = $app["swagger"]->getResourceList($options); |
|
31 | |||
32 | 11 | $response = Response::create($json, 200, array("Content-Type" => "application/json")); |
|
33 | 11 | $response->setCache($app["swagger.cache"]); |
|
34 | 11 | $response->setEtag(md5($json)); |
|
35 | 11 | $response->isNotModified($request); |
|
36 | |||
37 | 11 | return $response; |
|
38 | } |
||
39 | } |