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.
Completed
Push — master ( d39c6b...1e41a0 )
by Cees-Jan
02:33
created

Action::getKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php declare(strict_types=1);
2
3
namespace WyriHaximus\React;
4
5
use Cron\CronExpression;
6
use React\Promise\PromiseInterface;
7
use function React\Promise\resolve;
8
9
final class Action implements ActionInterface
10
{
11
    /** @var string */
12
    private $key;
13
14
    /** @var CronExpression */
15
    private $expression;
16
17
    /** @var callable */
18
    private $performer;
19
20
    /**
21
     * @param string   $key
22
     * @param string   $expression
23
     * @param callable $performer
24
     */
25 4
    public function __construct(string $key, string $expression, callable $performer)
26
    {
27 4
        $this->key = $key;
28 4
        $this->expression = CronExpression::factory($expression);
29 4
        $this->performer = $performer;
30 4
    }
31
32 2
    public function getKey(): string
33
    {
34 2
        return $this->key;
35
    }
36
37 3
    public function isDue(): bool
38
    {
39 3
        return $this->expression->isDue();
40
    }
41
42 3
    public function perform(): PromiseInterface
43
    {
44 3
        return resolve(
45 3
            ($this->performer)()
46
        );
47
    }
48
}
49