Completed
Pull Request — master (#75)
by
unknown
02:24
created

TotoPlugin   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 38
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A setStatus() 0 8 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