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.

Exception::lastError()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
ccs 0
cts 2
cp 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Deployer\Component\PharUpdate\Exception;
6
7
/**
8
 * Provides additional functional to the Exception class.
9
 *
10
 * @author Kevin Herrera <[email protected]>
11
 */
12
class Exception extends \Exception implements ExceptionInterface
13
{
14
    /**
15
     * Creates a new exception using a format and values.
16
     *
17
     * @param mixed  $value,... The value(s).
18
     */
19
    public static function create(string $format, $value = null): self
20
    {
21
        if (0 < func_num_args()) {
22
            $format = vsprintf($format, array_slice(func_get_args(), 1));
23
        }
24
25
        return new static($format);
26
    }
27
28
    /**
29
     * Creates an exception for the last error message.
30
     */
31
    public static function lastError(): self
32
    {
33
        $error = error_get_last();
34
35
        return new static($error['message']);
36
    }
37
}
38