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

Server::validateAcceptableMIMETypes()   A

Complexity

Conditions 4
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 4

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.2
c 0
b 0
f 0
ccs 6
cts 6
cp 1
cc 4
eloc 6
nc 2
nop 1
crap 4
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