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

ImmutableException::cannotModify()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
ccs 7
cts 7
cp 1
cc 1
eloc 6
nc 1
nop 1
crap 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