InvalidOrderException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
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 7
cts 7
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\Enum\Order;
8
9
class InvalidOrderException extends InvalidArgumentException implements InvalidOrderExceptionInterface
10
{
11 4
    public function __construct(string $given)
12
    {
13 4
        parent::__construct(
14 4
            sprintf(
15 4
                'Order must be either "%s" or "%s", "%s" given',
16 4
                Order::Asc,
17 4
                Order::Desc,
18 4
                $given
19 4
            )
20 4
        );
21
    }
22
}
23