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
22:04
created

AttributeParser::getMetadatas()   A

Complexity

Conditions 5
Paths 5

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 5
eloc 8
nc 5
nop 1
dl 0
loc 14
rs 9.6111
c 1
b 0
f 0
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 ReflectionClassConstant;
11
use ReflectionMethod;
12
use ReflectionProperty;
13
use Reflector;
14
15
class AttributeParser extends MetadataParser
16
{
17
    const METADATA_FORMAT = '#[%s]';
18
19
    public static function getMetadatas(Reflector $reflector): array
20
    {
21
        $attributes = [];
22
23
        switch (true) {
24
            case $reflector instanceof ReflectionClass:
25
            case $reflector instanceof ReflectionMethod:
26
            case $reflector instanceof ReflectionProperty:
27
            case $reflector instanceof ReflectionClassConstant:
28
                $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

28
                /** @scrutinizer ignore-call */ 
29
                $attributes = $reflector->getAttributes();
Loading history...
29
        }
30
31
        // @phpstan-ignore-next-line
32
        return array_map(fn (ReflectionAttribute $attribute) => $attribute->newInstance(), $attributes);
33
    }
34
}
35