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

MethodNotAllowedException::methodNotAllowed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 3
dl 0
loc 8
ccs 6
cts 6
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
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