Completed
Pull Request — master (#139)
by De Cramer
02:36
created

BestCheckpoints::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
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 1
nc 1
nop 2
crap 2
1
<?php
2
3
namespace eXpansion\Bundle\WidgetBestCheckpoints\Plugins;
4
5
use eXpansion\Bundle\WidgetBestCheckpoints\Plugins\Gui\BestCheckpointsWidgetFactory;
6
use eXpansion\Framework\Core\DataProviders\Listener\ListenerInterfaceExpApplication;
7
use eXpansion\Framework\Core\DataProviders\Listener\ListenerInterfaceMpLegacyPlayer;
8
use eXpansion\Framework\Core\Model\UserGroups\Group;
9
use eXpansion\Framework\Core\Storage\Data\Player;
10
use eXpansion\Framework\Core\Storage\PlayerStorage;
11
use Maniaplanet\DedicatedServer\Connection;
12
13
14
class BestCheckpoints implements ListenerInterfaceExpApplication, ListenerInterfaceMpLegacyPlayer
15
{
16
    /** @var Connection */
17
    protected $connection;
18
    /**
19
     * @var PlayerStorage
20
     */
21
    private $playerStorage;
22
    /**
23
     * @var BestCheckpointsWidgetFactory
24
     */
25
    private $widget;
26
    /**
27
     * @var Group
28
     */
29
    private $players;
30
31
    /**
32
     * Debug constructor.
33
     *
34
     * @param Connection $connection
35
     * @param PlayerStorage $playerStorage
36
     * @param BestCheckPointsWidgetFactory $widget
37
     */
38
    public function __construct(Connection $connection, PlayerStorage $playerStorage, BestCheckPointsWidgetFactory $widget, Group $players)
39
    {
40
        $this->connection = $connection;
41
        $this->playerStorage = $playerStorage;
42
        $this->widget = $widget;
43
        $this->players = $players;
44
    }
45
46
    /**
47
     * Set the status of the plugin
48
     *
49
     * @param boolean $status
50
     *
51
     * @return null
52
     */
53
    public function setStatus($status)
0 ignored issues
show
Unused Code introduced by
The parameter $status is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
54
    {
55
56
    }
57
58
    /**
59
     * called at eXpansion init
60
     *
61
     * @return void
62
     */
63
    public function onApplicationInit()
64
    {
65
66
67
    }
68
69
    /**
70
     * called when init is done and callbacks are enabled
71
     *
72
     * @return void
73
     */
74
    public function onApplicationReady()
75
    {
76
        $this->widget->create($this->players);
77
    }
78
79
    /**
80
     * called when requesting application stop
81
     *
82
     * @return void
83
     */
84
    public function onApplicationStop()
85
    {
86
        // TODO: Implement onApplicationStop() method.
87
    }
88
89
    public function onPlayerConnect(Player $player)
90
    {
91
92
    }
93
94
    public function onPlayerDisconnect(Player $player, $disconnectionReason)
95
    {
96
        // TODO: Implement onPlayerDisconnect() method.
97
    }
98
99
    public function onPlayerInfoChanged(Player $oldPlayer, Player $player)
100
    {
101
        // TODO: Implement onPlayerInfoChanged() method.
102
    }
103
104
    public function onPlayerAlliesChanged(Player $oldPlayer, Player $player)
105
    {
106
        // TODO: Implement onPlayerAlliesChanged() method.
107
    }
108
}
109