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
Pull Request — master (#24)
by Tomasz
07:22
created

PsalmEnum   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fromMemberAndValue() 0 3 1
A __construct() 0 4 1
1
<?php
2
declare(strict_types=1);
3
namespace Thunder\Platenum\Tests\Psalm;
4
5
use Thunder\Platenum\Enum\ConstantsEnumTrait;
6
7
/**
8
 * @psalm-template T of self::*
9
 * @psalm-immutable
10
 */
11
final class PsalmEnum
12
{
13
    /** @use ConstantsEnumTrait<T> */
14
    use ConstantsEnumTrait;
15
16
    public const FIRST = 1;
17
    public const SECOND = 2;
18
19
    /**
20
     * @psalm-param T $value
21
     * @psalm-assert T $value
22
     */
23
    public function __construct(int $value)
24
    {
25
        $this->member = static::valueToMember($value);
26
        $this->value = $value;
27
    }
28
29
    private static function fromMemberAndValue(string $member, int $value): self
0 ignored issues
show
Unused Code introduced by
The parameter $member is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

29
    private static function fromMemberAndValue(/** @scrutinizer ignore-unused */ string $member, int $value): self

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The method fromMemberAndValue() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
30
    {
31
        return new self($value);
32
    }
33
}
34
35
PsalmEnum::FIRST();
0 ignored issues
show
Bug introduced by
The method FIRST() does not exist on Thunder\Platenum\Tests\Psalm\PsalmEnum. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

35
PsalmEnum::/** @scrutinizer ignore-call */ 
36
           FIRST();
Loading history...
36
PsalmEnum::SECOND();
0 ignored issues
show
Bug introduced by
The method SECOND() does not exist on Thunder\Platenum\Tests\Psalm\PsalmEnum. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

36
PsalmEnum::/** @scrutinizer ignore-call */ 
37
           SECOND();
Loading history...
37
new PsalmEnum(4);
38