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.

NotAnEncodedThrowableException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WyriHaximus;
6
7
use Exception;
8
9
final class NotAnEncodedThrowableException extends Exception
10
{
11
    /** @var array<string, mixed> */
12
    private array $json;
13
    private string $field;
14
15
    /**
16
     * @param array<string, mixed> $json
17
     */
18
    public function __construct(array $json, string $field)
19
    {
20
        parent::__construct('Given array is not an encoded Throwable, at least one field is missing');
21
22
        $this->json  = $json;
23
        $this->field = $field;
24
    }
25
26
    /**
27
     * @return array<string, mixed>
28
     */
29
    public function json(): array
30
    {
31
        return $this->json;
32
    }
33
34
    public function field(): string
35
    {
36
        return $this->field;
37
    }
38
}
39