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 — develop ( 580c66...1db9ea )
by Baptiste
03:02 queued 20s
created

RegexException::__construct()   C

Complexity

Conditions 8
Paths 8

Size

Total Lines 29
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 29.5499
Metric Value
dl 0
loc 29
ccs 7
cts 23
cp 0.3043
rs 5.3846
cc 8
eloc 24
nc 8
nop 2
crap 29.5499
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 2
    public function __construct($message = '', $code = 0)
16
    {
17 2
        if ($message === '') {
18
            switch ($code) {
19 2
                case self::INTERNAL_ERROR:
20 2
                    $message = 'Internal error';
21 2
                    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 2
        parent::__construct($message, $code);
43 2
    }
44
}
45