CanNotMapParameterValue   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 52
wmc 3
lcom 1
cbo 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A forCommand() 0 8 1
A getCommand() 0 4 1
A getParameter() 0 4 1
1
<?php
2
3
namespace TillKruss\LaravelTactician\Exceptions;
4
5
use OutOfBoundsException;
6
7
class CanNotMapParameterValue extends OutOfBoundsException
8
{
9
    /**
10
     * The command's class name.
11
     *
12
     * @var string
13
     */
14
    private $command;
15
16
    /**
17
     * The parameter's name.
18
     *
19
     * @var string
20
     */
21
    private $parameter;
22
23
    /**
24
     * Creates a new exception.
25
     *
26
     * @param  string  $command
27
     * @param  string  $parameter
28
     * @return static
29
     */
30
    public static function forCommand($command, $parameter)
31
    {
32
        $exception = new static("Could not map parameter [{$parameter}] to command [{$command}].");
33
        $exception->command = $command;
34
        $exception->parameter = $parameter;
35
36
        return $exception;
37
    }
38
39
    /**
40
     * Returns class name of the command.
41
     *
42
     * @return string
43
     */
44
    public function getCommand()
45
    {
46
        return $this->command;
47
    }
48
49
    /**
50
     * Returns the name of the parameter.
51
     *
52
     * @return string
53
     */
54
    public function getParameter()
55
    {
56
        return $this->parameter;
57
    }
58
}
59