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

ImmutableException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
dl 0
loc 14
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A cannotModify() 0 6 1
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