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.

MethodValidator::__construct()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

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 3
eloc 5
nc 2
nop 2
crap 3
1
<?php
2
3
namespace Reflection\Validator;
4
5
/**
6
 * Validates method specification.
7
 */
8
class MethodValidator extends FunctionValidator
9
{
10
    /**
11
     * MethodValidator constructor.
12
     *
13
     * @param \ReflectionMethod $method
14
     *   A method to validate.
15
     * @param string $required_class
16
     *   A class in a scope of which method allowed to be defined.
17
     */
18 3
    public function __construct(\ReflectionMethod $method, string $required_class = '')
19
    {
20 3
        parent::__construct($method);
21
22 3
        if ('' !== $required_class && !is_a($method->class, $required_class, true)) {
23 1
            $this->exception->addError('The @function defined in the class that not inherits "@requiredClass".', [
24 1
                '@requiredClass' => $required_class,
25
            ]);
26
        }
27 3
    }
28
}
29