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.
Passed
Branch master (5205fe)
by Baptiste
02:45
created

RegexException::__construct()   C

Complexity

Conditions 8
Paths 8

Size

Total Lines 28
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 32.6218

Importance

Changes 0
Metric Value
cc 8
eloc 23
nc 8
nop 2
dl 0
loc 28
ccs 6
cts 22
cp 0.2727
crap 32.6218
rs 5.3846
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Immutable\Exception;
5
6
class RegexException extends \Exception implements ExceptionInterface
7
{
8
    const INTERNAL_ERROR = 1;
9
    const BACKTRACK_LIMIT_ERROR = 2;
10
    const RECURSION_LIMIT_ERROR = 3;
11
    const BAD_UTF8_ERROR = 4;
12
    const BAD_UTF8_OFFSET_ERROR = 5;
13
    const JIT_STACKLIMIT_ERROR = 6;
14
15 6
    public function __construct($message = '', $code = 0)
16
    {
17 6
        if ($message === '') {
18
            switch ($code) {
19 6
                case self::INTERNAL_ERROR:
20 6
                    $message = 'Internal error';
21 6
                    break;
22
                case self::BACKTRACK_LIMIT_ERROR:
23
                    $message = 'Backtrack limit error';
24
                    break;
25
                case self::RECURSION_LIMIT_ERROR:
26
                    $message = 'Recursion limit error';
27
                    break;
28
                case self::BAD_UTF8_ERROR:
29
                    $message = 'Bad UTF-8 error';
30
                    break;
31
                case self::BAD_UTF8_OFFSET_ERROR:
32
                    $message = 'Bad UTF-8 offset error';
33
                    break;
34
                case self::JIT_STACKLIMIT_ERROR:
35
                    $message = 'JIT stack limit error';
36
                    break;
37
                default:
38
                    $message = 'Regular expression error';
39
            }
40
        }
41
42 6
        parent::__construct($message, $code);
43 6
    }
44
}
45