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.

Action   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 2
cbo 1
dl 0
loc 40
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getKey() 0 4 1
A isDue() 0 4 1
A perform() 0 6 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 10
    public function __construct(string $key, string $expression, callable $performer)
26
    {
27 10
        $this->key = $key;
28 10
        $this->expression = CronExpression::factory($expression);
29 10
        $this->performer = $performer;
30 10
    }
31
32 8
    public function getKey(): string
33
    {
34 8
        return $this->key;
35
    }
36
37 9
    public function isDue(): bool
38
    {
39 9
        return $this->expression->isDue();
40
    }
41
42 9
    public function perform(): PromiseInterface
43
    {
44 9
        return resolve(
45 9
            ($this->performer)()
46
        );
47
    }
48
}
49