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 Timur
20:26
created

AttributeParser   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMetadatas() 0 13 4
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;
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. It seems like you code against a sub-type of said class. However, the method does not exist in ReflectionExtension or ReflectionZendExtension. Are you sure you never get one of those? ( 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();
Loading history...
27
        }
28
29
        // @phpstan-ignore-next-line
30
        return array_map(fn (ReflectionAttribute $attribute) => $attribute->newInstance(), $attributes);
31
    }
32
}
33