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

TotoPlugin::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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