TeamLeaderChangeEvent::getOldLeader()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * This file contains a team 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 thrown when a player gets the leadership of a team
12
 */
13 View Code Duplication
class TeamLeaderChangeEvent extends Event
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
{
15
    /**
16
     * @var \Team
17
     */
18
    protected $team;
19
20
    /**
21
     * @var \Player
22
     */
23
    protected $newLeader;
24
25
    /**
26
     * @var \Player
27
     */
28
    protected $oldLeader;
29
30
    /**
31
     * Create a new event
32
     *
33
     * @param \Team   $team      The team in question
34
     * @param \Player $newLeader The new leader of the team
35
     * @param \Player $oldLeader The former leader of the team
36
     */
37
    public function __construct(\Team $team, \Player $newLeader, \Player $oldLeader)
38
    {
39
        $this->team = $team;
40
        $this->newLeader = $newLeader;
41
        $this->oldLeader = $oldLeader;
42
    }
43
44
    /**
45
     * Get the team
46
     *
47
     * @return \Team
48
     */
49
    public function getTeam()
50
    {
51
        return $this->team;
52
    }
53
54
    /**
55
     * Get the new leader of the team
56
     *
57
     * @return \Player
58
     */
59
    public function getNewLeader()
60
    {
61
        return $this->newLeader;
62
    }
63
64
    /**
65
     * Get the former leader of the team
66
     *
67
     * @return \Player
68
     */
69
    public function getOldLeader()
70
    {
71
        return $this->oldLeader;
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function notify($type)
78
    {
79
        $this->doNotify($this->newLeader, $type);
80
    }
81
}
82