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::setContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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