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.

ServerException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 40
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A forInvalidPrefix() 0 10 1
A forInvalidMatcher() 0 10 1
1
<?php
2
3
/**
4
 * This file is part of WebHelper Parser.
5
 *
6
 * (c) James <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WebHelper\Parser\Server;
13
14
use InvalidArgumentException;
15
use WebHelper\Parser\Exception\ParserExceptionInterface;
16
17
/**
18
 * Unattended parameters.
19
 *
20
 * @author James <[email protected]>
21
 */
22
class ServerException extends InvalidArgumentException implements ParserExceptionInterface
23
{
24
    /**
25
     * The exception to throw if the prefix is invalid.
26
     *
27
     * @param string $prefix  the prefix
28
     * @param string $message the error message
29
     *
30
     * @return ServerException the exception to throw
31
     */
32 3
    public static function forInvalidPrefix($prefix, $message)
33
    {
34 3
        return new self(
35 3
            sprintf(
36 3
                $message,
37
                $prefix
38 3
            ),
39
            self::INVALID_SERVER_PREFIX
40 3
        );
41
    }
42
43
    /**
44
     * The exception to throw if a directive matcher is invalid.
45
     *
46
     * @param string $matcher the matcher
47
     * @param string $message the error message
48
     *
49
     * @return ServerException the exception to throw
50
     */
51 12
    public static function forInvalidMatcher($matcher, $message)
52
    {
53 12
        return new self(
54 12
            sprintf(
55 12
                $message,
56
                $matcher
57 12
            ),
58
            self::INVALID_DIRECTIVE_MATCHER
59 12
        );
60
    }
61
}
62