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

ObjectNotFoundException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDatetime() 0 3 1
A getKey() 0 3 1
A __construct() 0 6 1
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