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 ( f36ec7...f9ceef )
by Cees-Jan
09:11
created

AuthorizeEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
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 3
dl 0
loc 5
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
namespace WyriHaximus\Ratchet\Event;
12
13
use Cake\Event\Event;
14
use Cake\Event\EventManager;
15
use React\EventLoop\LoopInterface;
16
use React\Promise\Deferred;
17
use React\Promise\PromiseInterface;
18
use Thruway\Message\ActionMessageInterface;
19
use Thruway\Session;
20
21
class AuthorizeEvent extends Event
22
{
23
    const EVENT = 'WyriHaximus.Ratchet.%s.authorize';
24
25
    public static function realmEvent($realm)
26
    {
27
        return sprintf(self::EVENT, $realm);
28
    }
29
30
    /**
31
     * @var Deferred
32
     */
33
    private $deferred;
34
35
    /**
36
     * @param LoopInterface $loop
0 ignored issues
show
Bug introduced by
There is no parameter named $loop. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
37
     * @return static
38
     */
39
    public static function create($realm, Session $session, ActionMessageInterface $actionMsg)
40
    {
41
        return new static(self::realmEvent($realm), $actionMsg, [
42
            'realm' => $realm,
43
            'session' => $session,
44
            'actionMessage' => $actionMsg,
45
        ]);
46
    }
47
48
    public function __construct($name, $subject = null, $data = null)
49
    {
50
        parent::__construct($name, $subject, $data);
51
        $this->deferred = new Deferred();
52
    }
53
54
    /**
55
     * @return Session
56
     */
57
    public function getRealm()
58
    {
59
        return $this->data()['realm'];
60
    }
61
62
    /**
63
     * @return Session
64
     */
65
    public function getSession()
66
    {
67
        return $this->data()['session'];
68
    }
69
70
    /**
71
     * @return ActionMessageInterface
72
     */
73
    public function getActionMessage()
74
    {
75
        return $this->data()['actionMessage'];
76
    }
77
78
    /**
79
     * @return PromiseInterface
80
     */
81
    public function promise()
82
    {
83
        return $this->deferred->promise();
84
    }
85
86
    public function reject()
87
    {
88
        $this->deferred->reject();
89
    }
90
}