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.

Just::filter()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 3
c 1
b 0
f 1
nc 2
nop 1
dl 0
loc 7
rs 10
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Immutable\Maybe;
5
6
use Innmind\Immutable\Maybe;
7
8
/**
9
 * @template V
10
 * @implements Implementation<V>
11
 * @psalm-immutable
12
 * @internal
13
 */
14
final class Just implements Implementation
15
{
16
    /** @var V */
0 ignored issues
show
Bug introduced by
The type Innmind\Immutable\Maybe\V was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
    private $value;
18
19
    /**
20
     * @param V $value
21
     */
22
    public function __construct($value)
23
    {
24
        $this->value = $value;
25
    }
26
27
    public function map(callable $map): self
28
    {
29
        return new self($map($this->value));
30
    }
31
32
    public function flatMap(callable $map): Maybe
33
    {
34
        return $map($this->value);
35
    }
36
37
    public function match(callable $just, callable $nothing)
38
    {
39
        return $just($this->value);
40
    }
41
42
    public function otherwise(callable $otherwise): Maybe
43
    {
44
        return Maybe::just($this->value);
45
    }
46
47
    public function filter(callable $predicate): Implementation
48
    {
49
        if ($predicate($this->value) === true) {
50
            return $this;
51
        }
52
53
        return new Nothing;
54
    }
55
}
56