ConversationAbandonEvent::getMember()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * This file contains a conversation event
4
 *
5
 * @license    https://github.com/allejo/bzion/blob/master/LICENSE.md GNU General Public License Version 3
6
 */
7
8
namespace BZIon\Event;
9
10
/**
11
 * Event dispatched whenever someone leaves a conversation
12
 */
13
class ConversationAbandonEvent extends Event
14
{
15
    /**
16
     * @var \Conversation
17
     */
18
    protected $conversation;
19
20
    /**
21
     * @var \Player|\Team
22
     */
23
    protected $member;
24
25
    /**
26
     * Create a new event
27
     *
28
     * @param \Conversation        $conversation  The conversation that the player left
29
     * @param \Player|\Team $member The member who abandoned the conversation
30
     */
31
    public function __construct(\Conversation $conversation, \Model $member)
32
    {
33
        $this->conversation = $conversation;
34
        $this->member = $member;
0 ignored issues
show
Documentation Bug introduced by
It seems like $member of type object<Model> is incompatible with the declared type object<Player>|object<Team> of property $member.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
35
    }
36
37
    /**
38
     * Get the conversation that the player abandoned
39
     *
40
     * @return \Conversation
41
     */
42
    public function getConversation()
43
    {
44
        return $this->conversation;
45
    }
46
47
    /**
48
     * Get the member who left the conversation
49
     *
50
     * @return \Player|\Team
51
     */
52
    public function getMember()
53
    {
54
        return $this->member;
55
    }
56
}
57