Passed
Pull Request — master (#30)
by Baptiste
03:36 queued 01:24
created

NotFoundException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

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