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 ( 7c8224...62fb62 )
by Cees-Jan
08:39
created

AuthorizationManager::handleNewRealm()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 8
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\Security;
13
14
use Thruway\Event\MessageEvent;
15
use Thruway\Event\NewRealmEvent;
16
use Thruway\Module\RealmModuleInterface;
17
use Thruway\Module\RouterModuleClient;
18
19
class AuthorizationManager extends RouterModuleClient implements RealmModuleInterface
20
{
21
    /**
22
     * Listen for Router events.
23
     * Required to add the authorization module to the realm
24
     *
25
     * @return array
26
     */
27
    public static function getSubscribedEvents()
28
    {
29
        return [
30
            'new_realm' => ['handleNewRealm', 10]
31
        ];
32
    }
33
34
    /**
35
     * @param NewRealmEvent $newRealmEvent
36
     */
37
    public function handleNewRealm(NewRealmEvent $newRealmEvent)
38
    {
39
        $realm = $newRealmEvent->realm;
40
41
        if ($realm->getRealmName() === $this->getRealm()) {
42
            $realm->addModule($this);
43
        }
44
    }
45
46
    /**
47
     * @return array
48
     */
49
    public function getSubscribedRealmEvents()
50
    {
51
        return [
52
            'PublishMessageEvent'   => ['authorize', 100],
53
            'SubscribeMessageEvent' => ['authorize', 100],
54
            'RegisterMessageEvent'  => ['authorize', 100],
55
            'CallMessageEvent'      => ['authorize', 100],
56
        ];
57
    }
58
59
    /**
60
     * @param MessageEvent $msg
61
     */
62
    public function authorize(MessageEvent $msg)
0 ignored issues
show
Unused Code introduced by
The parameter $msg is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
63
    {
64
        /**
65
         * WIP auth handling
66
         */
67
    }
68
}
69