Completed
Push — master ( 769748...7b8fb0 )
by Baptiste
12s
created

NotFoundException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
namespace Behapi\ServiceContainer;
3
4
use Throwable;
5
use InvalidArgumentException;
6
7
use Interop\Container\Exception\NotFoundException as NotFoundExceptionInterface;
8
9
class NotFoundException extends InvalidArgumentException implements NotFoundExceptionInterface
10
{
11
    private $id;
12
13
    public function __construct(string $id, Throwable $previous = null)
14
    {
15
        parent::__construct("The service {$id} was not found in this container", 0, $previous);
16
17
        $this->id = $id;
18
    }
19
20
    public function getId(): string
21
    {
22
        return $this->id;
23
    }
24
}
25
26