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.

bootstrap()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 61
Code Lines 49

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 49
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 49
c 0
b 0
f 0
dl 0
loc 61
ccs 49
cts 49
cp 1
rs 9.1127
cc 1
nc 1
nop 1
crap 1

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\LabStation;
5
6
use Innmind\OperatingSystem\OperatingSystem;
7
use Innmind\CLI\Commands;
8
use Innmind\ProcessManager\{
9
    Manager\Parallel,
10
    Runner\SubProcess,
11
};
12
use Innmind\IPC\Process\Name;
13
use Innmind\Git\Git;
14
use Innmind\GitRelease\{
15
    SignedRelease,
16
    LatestVersion,
17
};
18
use function Innmind\FileWatch\bootstrap as watch;
19
use function Innmind\IPC\bootstrap as ipc;
20
21
function bootstrap(OperatingSystem $os): Commands
22
{
23 2
    $protocol = new Protocol\Json;
24 2
    $watch = watch($os);
25 2
    $ipc = ipc($os);
26 2
    $monitor = new Name('lab-station-'.$os->process()->id());
27 2
    $git = new Git($os->control(), $os->clock());
28
29 2
    return new Commands(
30 2
        new Command\Work(
31 2
            new Monitor(
32 2
                $protocol,
33 2
                new Parallel(
34 2
                    new SubProcess($os->process())
35
                ),
36 1
                $ipc,
37 1
                $monitor,
38 2
                new Trigger\All(
39 2
                    new Trigger\Graphs(
40 2
                        $os->filesystem(),
41 2
                        $os->control()->processes(),
42 2
                        $os->status()->tmp()
43
                    ),
44 2
                    new Trigger\Profiler(
45 2
                        $os->filesystem(),
46 2
                        $os->control()->processes()
47
                    ),
48 2
                    new Trigger\DockerCompose(
49 2
                        $os->filesystem(),
50 2
                        $os->control()->processes()
51
                    ),
52 2
                    new Trigger\Tests($os->control()->processes()),
53 2
                    new Trigger\Psalm(
54 2
                        $os->control()->processes(),
55 2
                        $os->filesystem()
56
                    ),
57 2
                    new Trigger\ComposerUpdate($os->control()->processes()),
58 2
                    new Trigger\GitRelease(
59 2
                        $git,
60 2
                        new SignedRelease,
61 2
                        new LatestVersion
62
                    )
63
                ),
64 2
                new Agent\WatchSources(
65 2
                    $protocol,
66 1
                    $watch,
67 1
                    $ipc,
68 1
                    $monitor
69
                ),
70 2
                new Agent\WatchTests(
71 2
                    $protocol,
72 1
                    $watch,
73 1
                    $ipc,
74 1
                    $monitor
75
                ),
76 2
                new Agent\WatchCurrentGitBranch(
77 2
                    $git,
78 1
                    $protocol,
79 1
                    $watch,
80 1
                    $ipc,
81 1
                    $monitor
82
                )
83
            )
84
        )
85
    );
86
}
87