Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — master (#801)
by Vincent
23:54
created

AttributeParser::getMetadatas()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 4
eloc 7
c 1
b 0
f 0
nc 4
nop 1
dl 0
loc 13
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Config\Parser;
6
7
use Overblog\GraphQLBundle\Config\Parser\MetadataParser\MetadataParser;
8
use ReflectionAttribute;
0 ignored issues
show
Bug introduced by
The type ReflectionAttribute was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use ReflectionClass;
10
use ReflectionMethod;
11
use ReflectionProperty;
12
use Reflector;
13
14
class AttributeParser extends MetadataParser
15
{
16
    const METADATA_FORMAT = '#[%s]';
17
18
    public static function getMetadatas(Reflector $reflector): array
19
    {
20
        $attributes = [];
21
22
        switch (true) {
23
            case $reflector instanceof ReflectionClass:
24
            case $reflector instanceof ReflectionMethod:
25
            case $reflector instanceof ReflectionProperty:
26
                $attributes = $reflector->getAttributes();
0 ignored issues
show
Bug introduced by
The method getAttributes() does not exist on Reflector. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
                /** @scrutinizer ignore-call */ 
27
                $attributes = $reflector->getAttributes();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
27
        }
28
29
        // @phpstan-ignore-next-line
30
        return array_map(fn (ReflectionAttribute $attribute) => $attribute->newInstance(), $attributes);
31
    }
32
}
33