Completed
Push — develop ( ab74f6...880247 )
by
unknown
10:28
created

NotFoundException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getId() 0 4 1
1
<?php
2
/**
3
 * @filesource
4
 * @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
5
 * @license MIT
6
 * @author Miroslav Fedeleš <[email protected]>
7
 * @since 0.27
8
 */
9
namespace Core\Entity\Exception;
10
11
/**
12
 * Exception indicating not found entity
13
 */
14
class NotFoundException extends \RuntimeException implements ExceptionInterface
15
{
16
17
    /**
18
     * @var string
19
     */
20
    protected $id;
21
22
    /**
23
     * @param string $id
24
     */
25
    public function __construct($id)
26
    {
27
        parent::__construct(sprintf('Entity with id "%s" not found', $id));
28
        
29
        $this->id = $id;
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getId()
36
    {
37
        return $this->id;
38
    }
39
}