Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
44 | public function swaggerAction() |
||
45 | { |
||
46 | $this->finder->files()->in($this->rootDir . '/cache')->name('swagger.json'); |
||
47 | |||
48 | if ($this->finder->count() != 1) { |
||
49 | throw new FatalErrorException('Failed to find a generated swagger file'); |
||
50 | } |
||
51 | |||
52 | foreach ($this->finder as $file) { |
||
53 | return new Response( |
||
54 | $file->getContents(), |
||
55 | Response::HTTP_OK, |
||
56 | [ |
||
57 | 'Content-Type' => 'application/json' |
||
58 | ], |
||
59 | false |
||
60 | ); |
||
61 | } |
||
62 | } |
||
63 | } |
||
64 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.