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
Push — master ( 05bc19...aa0e82 )
by Anton
02:15
created

Exception   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 18.18%

Importance

Changes 0
Metric Value
dl 0
loc 45
ccs 4
cts 22
cp 0.1818
rs 10
c 0
b 0
f 0
wmc 10
lcom 1
cbo 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 14 5
A setFilepath() 0 4 1
A await() 0 8 2
A getFilename() 0 4 1
A getLineNumber() 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 Throwable;
11
12
class Exception extends \Exception
13
{
14
    private static $awaitFilepath;
15
    private $filename;
16
    private $lineNumber;
17
18
    public function __construct($message = "", $code = 0, Throwable $previous = null)
19
    {
20
        if (function_exists('debug_backtrace')) {
21
            $trace = debug_backtrace();
22
            foreach ($trace as $t) {
23
                if (!empty($t['file']) && $t['file'] === self::$awaitFilepath) {
24
                    $this->filename = basename($t['file']);
25
                    $this->lineNumber = $t['line'];
26
                    break;
27
                }
28
            }
29
        }
30
        parent::__construct($message, $code, $previous);
31
    }
32
33
    public static function setFilepath($awaitFilepath): void
34
    {
35
        self::$awaitFilepath = $awaitFilepath;
36
    }
37
38 10
    public static function await()
39
    {
40 10
        if (function_exists('debug_backtrace')) {
41 10
            $trace = debug_backtrace();
42 10
            return self::$awaitFilepath = $trace[1]['file'];
43
        }
44
        return '';
45
    }
46
47
    public function getFilename()
48
    {
49
        return $this->filename;
50
    }
51
52
    public function getLineNumber()
53
    {
54
        return $this->lineNumber;
55
    }
56
}
57
58