InvalidModificationArgument   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A targetNotAllowed() 0 7 1
A modifcationClassNotFound() 0 4 1
1
<?php
2
3
namespace LaravelLangBundler\Exceptions;
4
5
use Exception;
6
7
class InvalidModificationArgument extends Exception
8
{
9
    /**
10
     * Invalid target passed.
11
     *
12
     * @param string $target
13
     *
14
     * @return static
15
     */
16
    public static function targetNotAllowed($target)
17
    {
18
        return new static(
19
            "Target {$target} is not allowed. ".
20
            "Allowed targets are 'key', 'value', and 'both'."
21
        );
22
    }
23
24
    /**
25
     * Invalid classname passed.
26
     *
27
     * @param string $className
28
     *
29
     * @return static
30
     */
31
    public static function modifcationClassNotFound($className)
32
    {
33
        return new static("Class {$className} can not be found.");
34
    }
35
}
36