Completed
Pull Request — master (#75)
by
unknown
07:18
created

TotoPlugin::onPlayerChat()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
c 0
b 0
f 0
rs 9.4285
cc 2
eloc 6
nc 2
nop 2
1
<?php
2
3
namespace eXpansion\Bundle\Acme\Plugins;
4
5
use eXpansion\Framework\Core\DataProviders\Listener\ChatDataListenerInterface;
6
use eXpansion\Framework\Core\Model\UserGroups\Group;
7
use eXpansion\Framework\Core\Plugins\Gui\ManialinkFactory;
8
use eXpansion\Framework\Core\Plugins\StatusAwarePluginInterface;
9
use eXpansion\Framework\Core\Services\Console;
10
use eXpansion\Framework\Core\Storage\Data\Player;
11
12
/**
13
 * TotoPlugin is a test plugin to be removed.
14
 *
15
 * @package eXpansion\Framework\Core\Plugins
16
 */
17
class TotoPlugin implements StatusAwarePluginInterface
18
{
19
    /** @var Console  */
20
    protected $console;
21
22
    /** @var ManialinkFactory */
23
    protected $mlFactory;
24
25
    /** @var Group  */
26
    protected $playersGroup;
27
28
    function __construct(
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
29
        Console $console,
30
        ManialinkFactory $mlFactory,
31
        Group $players
32
    )
33
    {
34
        $this->console = $console;
35
        $this->mlFactory = $mlFactory;
36
        $this->playersGroup = $players;
37
    }
38
39
    /**
40
     * Set the status of the plugin
41
     *
42
     * @param boolean $status
43
     *
44
     * @return null
45
     */
46
    public function setStatus($status)
47
    {
48
        if ($status) {
49
            $this->mlFactory->create($this->playersGroup);
50
        } else {
51
            $this->mlFactory->destroy($this->playersGroup);
52
        }
53
    }
54
}
55