Test Setup Failed
Push — master ( eaec61...fed08a )
by Ion
02:23
created

ObjectNotFoundException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Infrastructure\Exception;
6
7
class ObjectNotFoundException extends \Exception
8
{
9
    protected string $key;
10
    protected \DateTime $datetime;
11
12 8
    public function __construct(string $key, \DateTime $datetime)
13
    {
14 8
        $this->key = $key;
15 8
        $this->datetime = $datetime;
16
17 8
        parent::__construct(sprintf('Object with key "%s" not found', $key));
18 8
    }
19
20 1
    public function getKey(): string
21
    {
22 1
        return $this->key;
23
    }
24
25 1
    public function getDatetime(): \DateTime
26
    {
27 1
        return $this->datetime;
28
    }
29
}
30