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.

StaticEnumTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 6
c 2
b 0
f 1
dl 0
loc 15
ccs 5
cts 5
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 10 2
1
<?php
2
declare(strict_types=1);
3
namespace Thunder\Platenum\Enum;
4
5
use Thunder\Platenum\Exception\PlatenumException;
6
7
/**
8
 * @template TMember
9
 * @template TValue
10
 *
11
 * @author Tomasz Kowalczyk <[email protected]>
12 1
 */
13
trait StaticEnumTrait
14 12
{
15
    /** @use EnumTrait<TMember,TValue> */
16 12
    use EnumTrait;
17
18
    private static function resolve(): array
19 12
    {
20 1
        $class = static::class;
21
        // reflection instead of property_exists because of PHP 7.4 bug #78632
22
        // @see https://bugs.php.net/bug.php?id=78632
23 11
        if(false === (new \ReflectionClass($class))->hasProperty('mapping')) {
24
            throw PlatenumException::fromMissingMappingProperty($class);
25
        }
26
27
        return static::$mapping;
0 ignored issues
show
Bug Best Practice introduced by
The property mapping does not exist on Thunder\Platenum\Enum\StaticEnumTrait. Since you implemented __get, consider adding a @property annotation.
Loading history...
28
    }
29
}
30