getAllowedMethods()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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