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
Branch dev (718e6b)
by Jérémy
04:44 queued 02:58
created

Runner   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A listen() 0 12 1
1
<?php
2
3
namespace CapMousse\ReactRestify;
4
5
use React\EventLoop\Factory;
6
use React\Socket\Server as SocketServer;
7
use React\Http\Server as HttpServer;
8
9
class Runner
10
{
11
    private $app;
12
13
    public function __construct($app)
14
    {
15
        $this->app = $app;
16
    }
17
18
    public function listen($port, $host = '127.0.0.1')
19
    {
20
        $loop = Factory::create();
21
        $socket = new SocketServer($loop);
22
        $http = new HttpServer($socket);
23
24
        $http->on('request', $this->app);
25
        echo("Server running on {$host}:{$port}\n");
26
27
        $socket->listen($port, $host);
28
        $loop->run();
29
    }
30
}
31