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 — thruway-0.4 ( 6cdd38...7c8224 )
by Cees-Jan
20:30 queued 10:33
created

ConstructListener::implementedEvents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 9.4285
1
<?php
2
3
/*
4
 * This file is part of Ratchet.
5
 *
6
 ** (c) 2016 Cees-Jan Kiewiet
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WyriHaximus\Ratchet\Event;
13
14
use Cake\Core\Configure;
15
use Cake\Event\EventListenerInterface;
16
use Cake\Event\EventManager;
17
use Thruway\Peer\Router;
18
use Thruway\Transport\RatchetTransportProvider;
19
use WyriHaximus\Ratchet\Websocket\InternalClient;
20
21
class ConstructListener implements EventListenerInterface
22
{
23
    /**
24
     * @return array
25
     */
26
    public function implementedEvents()
27
    {
28
        return [
29
            ConstructEvent::EVENT => 'construct',
30
        ];
31
    }
32
33
    /**
34
     * @param ConstructEvent $event
35
     */
36
    public function construct(ConstructEvent $event)
37
    {
38
        $router = new Router($event->getLoop());
39
40
        foreach (Configure::read('WyriHaximus.Ratchet.realms') as $realm => $config) {
41
            $router->addInternalClient(new InternalClient($realm, $event->getLoop()));
42
        }
43
        $router->addTransportProvider(
44
            new RatchetTransportProvider(
45
                Configure::read('WyriHaximus.Ratchet.internal.address'),
46
                Configure::read('WyriHaximus.Ratchet.internal.port')
47
            )
48
        );
49
        //$router->getRealmManager()->setDefaultAuthorizationManager(new AllPermissiveAuthorizationManager());
0 ignored issues
show
Unused Code Comprehensibility introduced by
74% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
50
51
        EventManager::instance()->dispatch(WebsocketStartEvent::create($event->getLoop()));
52
53
        $router->start(false);
54
    }
55
}