Completed
Push — master ( df0ee0...ff98ab )
by Dawid
03:03 queued 01:33
created

Application::onRequest()   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
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 1
1
<?php declare(strict_types=1);
2
3
use FatCode\OpenApi\Annotation as Api;
4
use Psr\Http\Message\ServerRequestInterface;
5
use Psr\Http\Message\ResponseInterface;
6
use FatCode\OpenApi\Application\OnRequestListener;
7
use Zend\Diactoros\Response;
8
9
/**
10
 * Your entry point/front controller.
11
 *
12
 * @Api\Application(
13
 *     title = "Your application title",
14
 *     version = "1.0.0",
15
 *     servers = [
16
 *         @Api\Server(
17
 *             id = "development",
18
 *             port = 8080,
19
 *             host = "localhost"
20
 *         )
21
 *     ]
22
 * )
23
 */
24
class Application implements OnRequestListener
25
{
26
    public function onRequest(ServerRequestInterface $request) : ResponseInterface
27
    {
28
        return new Response('Hello world');
29
    }
30
}
31
32
# Run with `open-api run development`
33