ClientError   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A assertStatusCodeIsInRange() 0 6 3
1
<?php declare(strict_types=1);
2
3
namespace Meek\Http;
4
5
use InvalidArgumentException;
6
7
/**
8
 * Exception class modeling the 4xx (Client Error) class of HTTP status codes.
9
 *
10
 * @see https://tools.ietf.org/html/rfc7231#section-6.5
11
 * @author Nathan Bishop <[email protected]> (https://nathanbishop.name)
12
 * @copyright 2016 Nathan Bishop
13
 * @license The MIT license.
14
 */
15
class ClientError extends Exception
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20 3
    public function assertStatusCodeIsInRange(int $statusCode): void
21
    {
22 3
        if ($statusCode < 400 || $statusCode > 499) {
23 2
            throw new InvalidArgumentException('A client error status code ("4xx") was not provided');
24
        }
25 1
    }
26
}
27