CanNotMapParameterValue::getCommand()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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