Completed
Pull Request — master (#5)
by Dan Michael O.
07:03 queued 05:06
created

CommandException::getOutput()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
namespace pastuhov\Command;
3
4
class CommandException extends \RuntimeException
5
{
6
7
    protected $command;
8
    protected $output;
9
    protected $returnCode;
10
11 3
    public function __construct($command, $output, $returnCode)
12
    {
13 3
        $this->command = $command;
14 3
        $this->output = $output;
15 3
        $this->returnCode = $returnCode;
16
17 3
        $message = 'Command "' . $command. '" exited with code ' . $returnCode . ': ' . $output;
18 3
        parent::__construct($message);
19 3
    }
20
21
    public function getCommand()
22
    {
23
        return $this->command;
24
    }
25
26
    public function getOutput()
27
    {
28
        return $this->output;
29
    }
30
31
    public function getReturnCode()
32
    {
33
        return $this->returnCode;
34
    }
35
}