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 — develop ( 8a6344...962010 )
by Baptiste
02:40
created

WatchTests::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 10
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 4
crap 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\LabStation\Agent;
5
6
use Innmind\LabStation\{
7
    Agent,
8
    Protocol,
9
    Activity,
10
    Activity\Type,
11
};
12
use Innmind\FileWatch\Watch;
13
use Innmind\IPC\{
14
    IPC,
15
    Process\Name,
16
};
17
use Innmind\Url\{
18
    PathInterface,
19
    Path,
20
};
21
22
final class WatchTests implements Agent
23
{
24
    private $protocol;
25
    private $watch;
26
    private $ipc;
27
    private $monitor;
28
29 4
    public function __construct(
30
        Protocol $protocol,
31
        Watch $watch,
32
        IPC $ipc,
33
        Name $monitor
34
    ) {
35 4
        $this->protocol = $protocol;
36 4
        $this->watch = $watch;
37 4
        $this->ipc = $ipc;
38 4
        $this->monitor = $monitor;
39 4
    }
40
41 2
    public function __invoke(PathInterface $project): void
42
    {
43 2
        $tests = new Path($project.'/tests');
44
45
        ($this->watch)($tests)(function() {
46 2
            $monitor = $this->ipc->get($this->monitor);
47 2
            $monitor->send(
48 2
                $this->protocol->encode(
49 2
                    new Activity(Type::testsModified(), [])
50
                )
51
            );
52 2
            $monitor->close();
53 2
        });
54 2
    }
55
}
56