RouteMethodNotAllowedException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 34
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getRequest() 0 4 1
A getAllowedMethods() 0 4 1
1
<?php
2
3
namespace Thruster\Component\HttpRouter\Exception;
4
5
use Psr\Http\Message\RequestInterface;
6
7
/**
8
 * Class RouteMethodNotAllowedException
9
 *
10
 * @package Thruster\Component\HttpRouter\Exception
11
 * @author  Aurimas Niekis <[email protected]>
12
 */
13
class RouteMethodNotAllowedException extends \Exception
14
{
15
    /**
16
     * @var RequestInterface
17
     */
18
    protected $request;
19
20
    /**
21
     * @var array
22
     */
23
    protected $allowedMethods;
24
25 3
    public function __construct(RequestInterface $request, array $allowedMethods = [])
26
    {
27 3
        $this->request = $request;
28 3
        $this->allowedMethods = $allowedMethods;
29 3
    }
30
31
    /**
32
     * @return RequestInterface
33
     */
34 1
    public function getRequest() : RequestInterface
35
    {
36 1
        return $this->request;
37
    }
38
39
    /**
40
     * @return array
41
     */
42 3
    public function getAllowedMethods() : array
43
    {
44 3
        return $this->allowedMethods;
45
    }
46
}
47