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   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 10

Test Coverage

Coverage 100%
Metric Value
dl 0
loc 32
ccs 14
cts 14
cp 1
rs 10
wmc 2
lcom 0
cbo 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 16 1
A createCommands() 0 12 1
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