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.

ProcessFailedException   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 49
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 26 3
A getProcess() 0 4 1
1
<?php
2
/**
3
 * See class comment
4
 *
5
 * PHP Version 5
6
 *
7
 * @category Netresearch
8
 * @package  Netresearch\Kite\Exception
9
 * @author   Christian Opitz <[email protected]>
10
 * @license  http://www.netresearch.de Netresearch Copyright
11
 * @link     http://www.netresearch.de
12
 */
13
14
namespace Netresearch\Kite\Exception;
15
use Netresearch\Kite\Exception;
16
use Netresearch\Kite\Service\Process;
17
18
/**
19
 * Class ProcessFailedException
20
 *
21
 * @category Netresearch
22
 * @package  Netresearch\Kite\Exception
23
 * @author   Christian Opitz <[email protected]>
24
 * @license  http://www.netresearch.de Netresearch Copyright
25
 * @link     http://www.netresearch.de
26
 */
27
class ProcessFailedException extends Exception
28
{
29
    /**
30
     * @var Process
31
     */
32
    protected $process;
33
34
    /**
35
     * ProcessFailedException constructor.
36
     *
37
     * @param Process $process The process
38
     */
39
    public function __construct(Process $process)
40
    {
41
        if ($process->isSuccessful()) {
42
            throw new Exception('Expected a failed process, but the given process was successful.');
43
        }
44
45
        $error = sprintf(
46
            'The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s",
47
            $process->getCommandLine(),
48
            $process->getExitCode(),
49
            $process->getExitCodeText(),
50
            $process->getWorkingDirectory()
51
        );
52
53
        if (!$process->isOutputDisabled()) {
54
            $error .= sprintf(
55
                "\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s",
56
                $process->getOutput(),
57
                $process->getErrorOutput()
58
            );
59
        }
60
61
        parent::__construct($error);
62
63
        $this->process = $process;
64
    }
65
66
    /**
67
     * Get the process
68
     *
69
     * @return Process
70
     */
71
    public function getProcess()
72
    {
73
        return $this->process;
74
    }
75
}
76
77
?>
78