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.

MergeSet   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 30
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A combine() 0 3 1
A identity() 0 4 1
A of() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Immutable\Monoid;
5
6
use Innmind\Immutable\{
7
    Monoid,
8
    Set,
9
};
10
11
/**
12
 * @template T
13
 * @psalm-immutable
14
 * @implements Monoid<Set<T>>
15
 */
16
final class MergeSet implements Monoid
17
{
18
    /**
19
     * @template C of object
20
     *
21
     * @param class-string<C> $class
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string<C> at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string<C>.
Loading history...
22
     *
23
     * @return self<C>
24
     */
25
    public static function of(string $class = null): self
0 ignored issues
show
Unused Code introduced by
The parameter $class 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

25
    public static function of(/** @scrutinizer ignore-unused */ string $class = null): 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...
26
    {
27
        /** @var self<C> */
28
        return new self;
29
    }
30
31
    public function identity(): mixed
32
    {
33
        /** @var Set<T> */
34
        return Set::of();
35
    }
36
37
    /**
38
     * @param Set<T> $a
39
     * @param Set<T> $b
40
     *
41
     * @return Set<T>
42
     */
43
    public function combine(mixed $a, mixed $b): mixed
44
    {
45
        return $a->merge($b);
46
    }
47
}
48