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 ( dd213f...9082b5 )
by James
05:12
created

ServerException::forInvalidPrefix()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

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.4285
c 0
b 0
f 0
cc 1
eloc 6
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 WebHelper\Parser\Exception\ParserExceptionInterface;
15
use InvalidArgumentException;
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 $prefix  the matcher
0 ignored issues
show
Bug introduced by
There is no parameter named $prefix. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
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