CommandError::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
namespace hiapi\commands\error;
4
5
use hiapi\commands\BaseCommand;
6
7
/**
8
 * Class CommandError
9
 *
10
 * @author Dmytro Naumenko <[email protected]>
11
 */
12
abstract class CommandError
13
{
14
    /**
15
     * @var BaseCommand
16
     */
17
    private $command;
18
    /**
19
     * @var \Exception
20
     */
21
    private $exception;
22
23
    public function __construct(BaseCommand $command, \Exception $exception)
24
    {
25
        $this->command = $command;
26
        $this->exception = $exception;
27
    }
28
29
    /**
30
     * @return BaseCommand
31
     */
32
    public function getCommand(): BaseCommand
33
    {
34
        return $this->command;
35
    }
36
37
    /**
38
     * @return \Exception
39
     */
40
    public function getException(): \Exception
41
    {
42
        return $this->exception;
43
    }
44
45
    /**
46
     * @return int the status code for HTTP response
47
     */
48
    abstract public function getStatusCode(): int;
49
}
50