Completed
Push — master ( ff8f47...dbda64 )
by De Cramer
02:41 queued 39s
created

TotoPlugin   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 16
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A onPlayerChat() 0 5 1
1
<?php
2
3
namespace eXpansion\Core\Plugins;
4
5
use eXpansion\Core\DataProviders\Listener\ChatDataListenerInterface;
6
use eXpansion\Core\Services\Console;
7
use eXpansion\Core\Storage\Data\Player;
8
9
/**
10
 * TotoPlugin is a test plugin to be removed.
11
 *
12
 * @package eXpansion\Core\Plugins
13
 */
14
class TotoPlugin implements ChatDataListenerInterface
15
{
16
17
    public $console;
18
19
    function __construct(Console $console)
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...
20
    {
21
        $this->console = $console;
22
    }
23
24
    public function onPlayerChat(Player $player, $text)
25
    {
26
        $text = trim($text);
27
        $this->console->writeln('$ff0[' . trim($player->getNickName()) . '$ff0] ' . $text);
28
    }
29
}
30