ConversationKickEvent   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 73
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getConversation() 0 4 1
A getKicked() 0 4 1
A getKicker() 0 4 1
A getMember() 0 4 1
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 announced when someone a player is kicked from a conversation
12
 */
13
class ConversationKickEvent extends Event
14
{
15
    /**
16
     * @var \Conversation
17
     */
18
    protected $conversation;
19
20
    /**
21
     * @var \Player|\Team
22
     */
23
    protected $kicked;
24
25
    /**
26
     * @var \Player
27
     */
28
    protected $kicker;
29
30
    /**
31
     * Create a new event
32
     *
33
     * @param \Conversation        $conversation  The conversation from which the player was kicked
34
     * @param \Player|\Team $kicked The member who was kicked
35
     * @param \Player       $kicker The player who issued the kick
36
     */
37
    public function __construct(\Conversation $conversation, \Model $kicked, \Player $kicker)
38
    {
39
        $this->conversation = $conversation;
40
        $this->kicked = $kicked;
0 ignored issues
show
Documentation Bug introduced by
It seems like $kicked of type object<Model> is incompatible with the declared type object<Player>|object<Team> of property $kicked.

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...
41
        $this->kicker = $kicker;
42
    }
43
44
    /**
45
     * Get the conversation from which the player was kicked
46
     *
47
     * @return \Conversation
48
     */
49
    public function getConversation()
50
    {
51
        return $this->conversation;
52
    }
53
54
    /**
55
     * Get the member who was kicked
56
     *
57
     * @return \Player|\Team
58
     */
59
    public function getKicked()
60
    {
61
        return $this->kicked;
62
    }
63
64
    /**
65
     * Get the member who was kicked
66
     *
67
     * Alias for ConversationKickEvent::getKicked()
68
     *
69
     * @return \Player|\Team
70
     */
71
    public function getMember()
72
    {
73
        return $this->kicked;
74
    }
75
76
    /**
77
     * Get the player who issued the kick
78
     *
79
     * @return \Player
80
     */
81
    public function getKicker()
82
    {
83
        return $this->kicker;
84
    }
85
}
86