Completed
Push — master ( 90fd7e...b7f6a5 )
by Dawid
02:15
created

MethodNotAllowedException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A methodNotAllowed() 0 8 1
1
<?php declare(strict_types=1);
2
3
namespace Igni\Http\Exception;
4
5
class MethodNotAllowedException extends HttpException
6
{
7 1
    public static function methodNotAllowed($uri, $method, $allowedMethods)
8
    {
9 1
        $allowedMethods = implode(', ', $allowedMethods);
10 1
        $exception = new self(
11 1
            "Method `$method` not allowed. This uri `$uri` allows only $allowedMethods http methods.",
12 1
            405
13
        );
14 1
        return $exception;
15
    }
16
}
17