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

ImmutableEntityException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
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 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
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
}