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.
Completed
Push — master ( 245b97...a80bec )
by Cees-Jan
08:40
created

ApiErrorException   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 29
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 1
A createWithErrors() 0 6 1
A getContext() 0 4 1
A setContext() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Client\Github;
4
5
use Exception;
6
use Throwable;
7
8
final class ApiErrorException extends Exception
9
{
10
    /**
11
     * @var array
12
     */
13
    private $context = [];
14
15
    public static function create(string $message, int $code, Throwable $previous): self
16
    {
17
        return new self($message, $code, $previous);
18
    }
19
20
    public static function createWithErrors(string $message, int $code, array $errors, Throwable $previous): self
21
    {
22
        $exception = new self($message, $code, $previous);
23
        $exception->setContext($errors);
24
        return $exception;
25
    }
26
27
    public function getContext(): array
28
    {
29
        return $this->context;
30
    }
31
32
    private function setContext(array $context)
33
    {
34
        $this->context = $context;
35
    }
36
}
37