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   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 21
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 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