Completed
Push — master ( f9ded0...b13d5b )
by John
02:58 queued 01:00
created

Server::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 11
rs 9.4285
c 1
b 0
f 0
ccs 6
cts 6
cp 1
cc 1
eloc 9
nc 1
nop 4
crap 1
1
<?php
2
namespace LunixREST\Server;
3
4
use LunixREST\Endpoint\Exceptions\UnknownEndpointException;
5
use LunixREST\Exceptions\AccessDeniedException;
6
use LunixREST\Exceptions\InvalidAPIKeyException;
7
use LunixREST\Exceptions\ThrottleLimitExceededException;
8
use LunixREST\APIRequest\APIRequest;
9
use LunixREST\APIResponse\Exceptions\NotAcceptableResponseTypeException;
10
use LunixREST\APIResponse\APIResponse;
11
use LunixREST\Server\Exceptions\MethodNotFoundException;
12
13
/**
14
 * Turns an APIRequest into an APIResponse
15
 * Interface Server
16
 * @package LunixREST\Server
17
 */
18
interface Server
19
{
20
    /**
21
     * @param APIRequest $request
22
     * @return APIResponse
23
     * @throws InvalidAPIKeyException
24
     * @throws AccessDeniedException
25
     * @throws ThrottleLimitExceededException
26
     * @throws UnknownEndpointException
27
     * @throws MethodNotFoundException
28
     * @throws NotAcceptableResponseTypeException
29
     */
30
    public function handleRequest(APIRequest $request): APIResponse;
31
}
32