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

InvalidOrderException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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