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 ( 7a57b5...f1ee52 )
by Baptiste
02:34
created

RegexException::__construct()   C

Complexity

Conditions 8
Paths 8

Size

Total Lines 29
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Code Coverage

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