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   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 24
rs 10
ccs 0
cts 9
cp 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 7 2
A lastError() 0 5 1
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