1 | <?php |
||
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 |