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 ( e51949...763526 )
by Anton
01:57
created

Exception::getFilename()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
crap 2
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 $recipeFile;
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::$recipeFile) {
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 10
    public static function await()
34
    {
35 10
        if (function_exists('debug_backtrace')) {
36 10
            $trace = debug_backtrace();
37 10
            self::$recipeFile = $trace[1]['file'];
38
        }
39 10
    }
40
41
    public function getFilename()
42
    {
43
        return $this->filename;
44
    }
45
46
    public function getLineNumber()
47
    {
48
        return $this->lineNumber;
49
    }
50
}
51
52