Completed
Push — master ( b8b783...188bc3 )
by De Cramer
9s
created

DispatchLogger   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 33
rs 10
c 0
b 0
f 0
ccs 0
cts 12
cp 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A init() 0 4 1
A dispatch() 0 5 1
1
<?php
2
3
namespace eXpansion\Core\Services\Application;
4
5
use eXpansion\Core\Services\Console;
6
use eXpansion\Core\Services\DataProviderManager;
7
use eXpansion\Core\Services\PluginManager;
8
9
/**
10
 * Class DispatchLogger, logs every dedicated server event.
11
 *
12
 * @package eXpansion\Core\Services\Application
13
 * @author Oliver de Cramer
14
 */
15
class DispatchLogger implements DispatcherInterface
16
{
17
    /** @var Console  */
18
    protected $console;
19
20
    /**
21
     * Dispatcher constructor.
22
     *
23
     * @param DataProviderManager $dataProviderManager
0 ignored issues
show
Bug introduced by
There is no parameter named $dataProviderManager. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
24
     * @param PluginManager $pluginManager
0 ignored issues
show
Bug introduced by
There is no parameter named $pluginManager. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
25
     */
26
    public function __construct(Console $console)
27
    {
28
        $this->console = $console;
29
    }
30
31
    /**
32
     * Init.
33
     */
34
    public function init()
35
    {
36
        // Nothing to do here.
37
    }
38
39
    /**
40
     * @inheritdoc
41
     */
42
    public function dispatch($event, $params)
43
    {
44
        $this->console->getConsoleOutput()->writeln("<info>$event");
45
        $this->console->getConsoleOutput()->writeln(print_r($params, true));
46
    }
47
}