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.

InvalidRegex::__construct()   B
last analyzed

Complexity

Conditions 8
Paths 8

Size

Total Lines 28
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 8
eloc 23
c 0
b 0
f 0
nc 8
nop 2
dl 0
loc 28
rs 8.4444
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Immutable\Exception;
5
6
class InvalidRegex extends LogicException
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
    public function __construct(string $message = '', int $code = 0)
16
    {
17
        if ($message === '') {
18
            switch ($code) {
19
                case self::INTERNAL_ERROR:
20
                    $message = 'Internal error';
21
                    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
        parent::__construct($message, $code);
43
    }
44
}
45