Passed
Push — 1.x ( b3225d...798396 )
by Ulises Jeremias
02:37
created

ImmutableException::cannotModify()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 6
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
1
<?php namespace Mbh\Exceptions;
2
3
/**
4
 * MBHFramework
5
 *
6
 * @link      https://github.com/MBHFramework/mbh-framework
7
 * @copyright Copyright (c) 2017 Ulises Jeremias Cornejo Fandos
8
 * @license   https://github.com/MBHFramework/mbh-framework/blob/master/LICENSE (MIT License)
9
 */
10
11
use RuntimeException;
12
13
/**
14
 *
15
 * @package structures
16
 * @author Ulises Jeremias Cornejo Fandos <[email protected]>
17
 */
18
class ImmutableException extends RuntimeException
19
{
20
    /**
21
     * @param string $class
22
     * @param string $method
23
     *
24
     * @return static
25
     */
26
    public static function cannotModify($class, $method)
27
    {
28
        return new static(sprintf(
29
            'Cannot modify immutable class `%s` using array `%s` method',
30
            $class,
31
            $method
32
        ));
33
    }
34
}
35