Completed
Pull Request — master (#21)
by De Cramer
02:11
created

AbstractUserGroupPlugin::onPlayerDisconnect()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
3
4
namespace eXpansion\Core\Plugins\UserGroups;
5
6
use eXpansion\Core\DataProviders\Listener\PlayerDataListenerInterface;
7
use eXpansion\Core\Model\UserGroups\Group;
8
use eXpansion\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 4
    public function __construct(Group $userGroup)
20
    {
21 4
        $this->userGroup = $userGroup;
22 4
    }
23
24
    /**
25
     * @inheritdoc
26
     */
27 1
    public function onPlayerDisconnect(Player $player, $disconnectionReason)
28
    {
29 1
        $this->userGroup->removeLogin($player->getLogin());
30 1
    }
31
32
    /**
33
     * @inheritdoc
34
     */
35 1
    public function onPlayerInfoChanged(Player $oldPlayer, Player $player)
36
    {
37
        // By default nothing.
38 1
    }
39
40
    /**
41
     * @inheritdoc
42
     */
43 1
    public function onPlayerAlliesChanged(Player $oldPlayer, Player $player)
44
    {
45
        // By default nothing.
46
    }
47
}