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

CommandException   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 53.85%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 32
ccs 7
cts 13
cp 0.5385
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A getCommand() 0 4 1
A getOutput() 0 4 1
A getReturnCode() 0 4 1
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
}