Conditions | 3 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 3.0032 |
Changes | 0 |
1 | <?php |
||
16 | public function __construct( |
||
17 | 2 | Process $process, |
|
18 | \Throwable $previous = null, |
||
19 | 2 | string $failureReason = "", |
|
20 | 2 | int $code = 0 |
|
21 | 2 | ) { |
|
22 | 2 | $this->process = $process; |
|
23 | 2 | ||
24 | 2 | $message = \Safe\sprintf( |
|
25 | 2 | 'Process with command "%s" has failed%s with exit code %d(%s)%s', |
|
26 | $process->getCommandLine(), |
||
27 | $process->isStarted() ? ' running' : '', |
||
28 | 2 | $process->getExitCode(), |
|
29 | 2 | $process->getExitCodeText(), |
|
30 | 2 | $failureReason ? ' because "' . $failureReason . '"' : '' |
|
31 | 2 | ); |
|
32 | |||
33 | 2 | parent::__construct( |
|
34 | $message, |
||
35 | $code, |
||
36 | $previous |
||
37 | ); |
||
45 |