ImmutableException::cannotModify()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Equip\Structure;
4
5
use RuntimeException;
6
7
class ImmutableException extends RuntimeException
8
{
9
    /**
10
     * @param string $class
11
     *
12
     * @return static
13
     */
14 4
    public static function cannotModify($class)
15
    {
16 4
        return new static(sprintf(
17 4
            'Cannot modify immutable class `%s` using array methods',
18
            $class
19 4
        ));
20
    }
21
}
22