Passed
Push — master ( 5ad58b...7269b1 )
by Chris
07:31
created

InvalidOrderException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 7
c 1
b 0
f 0
dl 0
loc 10
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php
2
3
namespace WebTheory\Collection\Exception;
4
5
use InvalidArgumentException;
6
use WebTheory\Collection\Contracts\InvalidOrderExceptionInterface;
7
use WebTheory\Collection\Contracts\OrderInterface;
8
9
class InvalidOrderException extends InvalidArgumentException implements InvalidOrderExceptionInterface
10
{
11 6
    public function __construct(string $given)
12
    {
13 6
        parent::__construct(
14 6
            sprintf(
15
                'Order must be either "%s" or "%s", "%s" given',
16
                OrderInterface::ASC,
17
                OrderInterface::DESC,
18
                $given
19
            )
20
        );
21
    }
22
}
23