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::forInvalidMatcher()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 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