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 ( 6ac76d...bfd754 )
by Cees-Jan
03:25
created

Factory::createCommands()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 0
loc 12
ccs 9
cts 9
cp 1
crap 1
rs 9.4285
1
<?php
2
declare(strict_types=1);
3
4
/*
5
 * This file is part of PhuninNode.
6
 *
7
 ** (c) 2013 - 2016 Cees-Jan Kiewiet
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace WyriHaximus\PhuninNode;
14
15
use React\EventLoop\LoopInterface;
16
use React\Socket\Server;
17
use WyriHaximus\PhuninNode\Commands;
18
19
class Factory
20
{
21 1
    public static function create(
22
        LoopInterface $loop,
23
        string $ip,
24
        int $port,
25
        Configuration $configuration = null
26
    ): Node {
27 1
        $socket = new Server($loop);
28 1
        $socket->listen($port, $ip);
29
30 1
        return new Node(
31
            $loop,
32
            $socket,
33 1
            self::createCommands(),
34
            $configuration
35
        );
36
    }
37
38 43
    public static function createCommands(): CommandsCollection
39
    {
40 43
        return new CommandsCollection([
41 43
            'cap' => new Commands\Cap(),
42 43
            'config' => new Commands\Config(),
43 43
            'fetch' => new Commands\Fetch(),
44 43
            'list' => new Commands\Lst(),
45 43
            'nodes' => new Commands\Nodes(),
46 43
            'quit' => new Commands\Quit(),
47 43
            'version' => new Commands\Version(),
48
        ]);
49
    }
50
}
51