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 ( b3cd52...71bd8a )
by Anton
02:19
created

Exception   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 36
ccs 0
cts 26
cp 0
rs 10
c 0
b 0
f 0
wmc 8
lcom 1
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 14 5
A setTaskSourceLocation() 0 4 1
A getTaskFilename() 0 4 1
A getTaskLineNumber() 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 $taskSourceLocation;
15
    private $taskFilename;
16
    private $taskLineNumber;
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::$taskSourceLocation) {
24
                    $this->taskFilename = basename($t['file']);
25
                    $this->taskLineNumber = $t['line'];
26
                    break;
27
                }
28
            }
29
        }
30
        parent::__construct($message, $code, $previous);
31
    }
32
33
    public static function setTaskSourceLocation(string $filepath): void
34
    {
35
        self::$taskSourceLocation = $filepath;
36
    }
37
38
    public function getTaskFilename()
39
    {
40
        return $this->taskFilename;
41
    }
42
43
    public function getTaskLineNumber()
44
    {
45
        return $this->taskLineNumber;
46
    }
47
}
48
49