App   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 8

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 8
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 17 1
1
<?php
2
3
namespace BeyondCode\DuskDashboard\Ratchet\Server;
4
5
use Ratchet\Http\Router;
6
use Ratchet\Server\IoServer;
7
use React\EventLoop\LoopInterface;
8
use React\Socket\Server as Reactor;
9
use Symfony\Component\Routing\Matcher\UrlMatcher;
10
use Symfony\Component\Routing\RequestContext;
11
use Symfony\Component\Routing\RouteCollection;
12
13
class App extends \Ratchet\App
14
{
15
    public function __construct($httpHost, $port, $address, LoopInterface $loop)
16
    {
17
        $this->httpHost = $httpHost;
18
        $this->port = $port;
19
20
        $socket = new Reactor($address.':'.$port, $loop);
21
22
        $this->routes = new RouteCollection;
23
24
        $urlMatcher = new UrlMatcher($this->routes, new RequestContext);
25
26
        $router = new Router($urlMatcher);
27
28
        $httpServer = new HttpServer($router);
29
30
        $this->_server = new IoServer($httpServer, $socket, $loop);
31
    }
32
}
33