GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#1904)
by Anton
02:17
created

RunException   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 71
ccs 0
cts 51
cp 0
rs 10
c 0
b 0
f 0
wmc 9
lcom 1
cbo 2

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 20 1
A getFilename() 0 4 1
A getLineNumber() 0 4 1
A getHostname() 0 4 1
A getCommand() 0 4 1
A getExitCode() 0 4 1
A getExitCodeText() 0 4 1
A getOutput() 0 4 1
A getErrorOutput() 0 4 1
1
<?php declare(strict_types=1);
2
/* (c) Anton Medvedev <[email protected]>
3
 *
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace Deployer\Exception;
9
10
use Symfony\Component\Process\Process;
11
12
class RunException extends Exception
13
{
14
    private $filename;
15
    private $lineNumber;
16
    private $hostname;
17
    private $command;
18
    private $exitCode;
19
    private $output;
20
    private $errorOutput;
21
22
    public function __construct(
23
        string $filename,
24
        int $lineNumber,
25
        string $hostname,
26
        string $command,
27
        int $exitCode,
28
        string $output,
29
        string $errorOutput
30
    ) {
31
        $this->filename = $filename;
32
        $this->lineNumber = $lineNumber;
33
        $this->hostname = $hostname;
34
        $this->command = $command;
35
        $this->exitCode = $exitCode;
36
        $this->output = $output;
37
        $this->errorOutput = $errorOutput;
38
39
        $message = sprintf('The command "%s" failed.', $command);
40
        parent::__construct($message, $exitCode);
41
    }
42
43
    public function getFilename()
44
    {
45
        return $this->filename;
46
    }
47
48
    public function getLineNumber()
49
    {
50
        return $this->lineNumber;
51
    }
52
53
    public function getHostname(): string
54
    {
55
        return $this->hostname;
56
    }
57
58
    public function getCommand(): string
59
    {
60
        return $this->command;
61
    }
62
63
    public function getExitCode(): int
64
    {
65
        return $this->exitCode;
66
    }
67
68
    public function getExitCodeText(): string
69
    {
70
        return Process::$exitCodes[$this->exitCode] ?? 'Unknown error';
71
    }
72
73
    public function getOutput(): string
74
    {
75
        return $this->output;
76
    }
77
78
    public function getErrorOutput(): string
79
    {
80
        return $this->errorOutput;
81
    }
82
}
83