Completed
Pull Request — master (#59)
by De Cramer
11:58 queued 07:04
created

AbstractUserGroupPlugin::onPlayerAlliesChanged()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 2
crap 2
1
<?php
2
3
4
namespace eXpansion\Framework\Core\Plugins\UserGroups;
5
6
use eXpansion\Framework\Core\DataProviders\Listener\PlayerDataListenerInterface;
7
use eXpansion\Framework\Core\Model\UserGroups\Group;
8
use eXpansion\Framework\Core\Storage\Data\Player;
9
10
abstract class AbstractUserGroupPlugin  implements PlayerDataListenerInterface
0 ignored issues
show
Coding Style introduced by
Expected 1 space after class name; 2 found
Loading history...
Coding Style introduced by
Expected 1 space before implements keyword; 2 found
Loading history...
11
{
12
    protected $userGroup;
13
14
    /**
15
     * AbstractUserGroupPlugin constructor.
16
     *
17
     * @param Group $userGroup
18
     */
19
    public function __construct(Group $userGroup)
20
    {
21
        $this->userGroup = $userGroup;
22
    }
23
24
    /**
25
     * @inheritdoc
26
     */
27
    public function onPlayerDisconnect(Player $player, $disconnectionReason)
28
    {
29
        $this->userGroup->removeLogin($player->getLogin());
30
    }
31
32
    /**
33
     * @inheritdoc
34
     */
35
    public function onPlayerInfoChanged(Player $oldPlayer, Player $player)
36
    {
37
        // By default nothing.
38
    }
39
40
    /**
41
     * @inheritdoc
42
     */
43
    public function onPlayerAlliesChanged(Player $oldPlayer, Player $player)
44
    {
45
        // By default nothing.
46
    }
47
}