Completed
Push — develop ( 168e99...0122be )
by
unknown
18:37 queued 07:11
created

ImmutableEntityException::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @license MIT
7
 * @copyright  2013 - 2016 Cross Solution <http://cross-solution.de>
8
 */
9
  
10
/** */
11
namespace Core\Entity\Exception;
12
13
/**
14
 * ${CARET}
15
 * 
16
 * @author Mathias Gelhausen <[email protected]>
17
 * @todo write test 
18
 */
19
class ImmutableEntityException extends \RuntimeException implements ExceptionInterface
20
{
21
    /**
22
     * Creates an ImmutableEntityException.
23
     *
24
     * @param \Core\Entity\EntityInterface|string $entity Entity class or class name.
25
     */
26
    public function __construct($entity)
27
    {
28
        if (is_object($entity)) {
29
            $entity = get_class($entity);
30
        }
31
32
        $message = sprintf('%s is an immutable entity.', $entity);
33
34
        parent::__construct($message);
35
    }
36
}