Completed
Push — master ( d2a62a...df0ee0 )
by Dawid
28s queued 11s
created

getSomething()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
dl 0
loc 3
c 1
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php declare(strict_types=1);
2
3
use FatCode\OpenApi\Annotation as Api;
4
use FatCode\OpenApi\Http\Response;
5
use FatCode\OpenApi\Schema\TextPlain;
6
use Psr\Http\Message\ResponseInterface;
7
use Psr\Http\Message\ServerRequestInterface;
8
9
/**
10
 * @Api\Application(
11
 *     version="1.0.0",
12
 *     title="Example get route",
13
 *     servers=[
14
 *         @Api\Server(port=8080, host="localhost")
15
 *     ],
16
 * )
17
 */
18
class Application
19
{
20
}
21
22
/**
23
 * @Api\PathItem\Get(
24
 *     route="/something/{id}",
25
 *     parameters=[
26
 *         @Api\Parameter(name="id", in="path", schema=@Api\Schema(type="int"))
27
 *     ],
28
 *     responses=[
29
 *         @Api\Response(code=200, schema=@Api\Reference(TextPlain::class))
30
 *     ]
31
 * )
32
 *
33
 * @param ServerRequestInterface $request
34
 * @return ResponseInterface
35
 */
36
function getSomething(ServerRequestInterface $request) : ResponseInterface
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

36
function getSomething(/** @scrutinizer ignore-unused */ ServerRequestInterface $request) : ResponseInterface

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
37
{
38
    return new Response(200, "Hello world");
39
}
40
41
42
//open-api build ./src
43