MethodNotAllowedException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 27
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A getRequest() 0 4 1
A getAllowedMethods() 0 4 1
1
<?php
2
3
namespace IdNet\InvokerRouterMiddleware\Exception;
4
5
use Exception;
6
use Psr\Http\Message\ServerRequestInterface;
7
8
class MethodNotAllowedException extends Exception
9
{
10
    /** @var ServerRequestInterface */
11
    protected $request;
12
13
    protected $allowedMethods = [];
14
15 3
    public function __construct(
16
        ServerRequestInterface $request,
17
        $allowedMethods,
18
        $code = 405
19
    ) {
20 3
        $this->request = $request;
21 3
        $this->allowedMethods = $allowedMethods;
22 3
        parent::__construct("Method not allowed", $code);
23 3
    }
24
25 1
    public function getRequest()
26
    {
27 1
        return $this->request;
28
    }
29
30 1
    public function getAllowedMethods()
31
    {
32 1
        return $this->allowedMethods;
33
    }
34
}
35