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   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 12 2
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