Completed
Pull Request — master (#6)
by Woody
02:53
created

ImmutableException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 20
rs 10
ccs 7
cts 7
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A cannotModify() 0 10 1
1
<?php
2
3
namespace Equip\Command;
4
5
use LogicException;
6
7
class ImmutableException extends LogicException
8
{
9
    const CANNOT_MODIFY = 1;
10
11
    /**
12
     * @param object $object
13
     *
14
     * @return static
15
     */
16 2
    public static function cannotModify($object)
17
    {
18 2
        return new static(
19 2
            sprintf(
20 2
                'Object `%s` is immutable and cannot be modified',
21 2
                get_class($object)
22 2
            ),
23
            static::CANNOT_MODIFY
24 2
        );
25
    }
26
}
27