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.
Passed
Push — master ( d7344e...89c4ce )
by Tomasz
14:40 queued 04:30
created

AttributeEnumTrait::resolve()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 6
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 12
rs 10
1
<?php
2
declare(strict_types=1);
3
namespace Thunder\Platenum\Enum;
4
5
/**
6
 * @author Tomasz Kowalczyk <[email protected]>
7
 */
8
trait AttributeEnumTrait
9
{
10
    use EnumTrait;
11
12
    /** @psalm-suppress UndefinedDocblockClass, UndefinedMethod because there is no ReflectionAttribute on PHP <8.0 */
13
    private static function resolve(): array
14
    {
15
        /** @var \ReflectionAttribute[] $attributes */
16
        $attributes = (new \ReflectionClass(static::class))->getAttributes(Member::class);
17
        $members = [];
18
        foreach($attributes as $attribute) {
19
            /** @var Member $member */
20
            $member = $attribute->newInstance();
21
            $members[$member->member] = $member->value;
22
        }
23
24
        return $members;
25
    }
26
}
27