BridgetConsoleLogger   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 72
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A logSuccess() 0 4 1
A logError() 0 4 1
A log() 0 4 1
A logInline() 0 4 1
A logMeta() 0 4 1
1
<?php
2
3
namespace N98\Magento\Command\System\Setup;
4
5
use Magento\Framework\Setup\LoggerInterface;
6
use Symfony\Component\Console\Output\OutputInterface;
7
8
class BridgetConsoleLogger implements LoggerInterface
9
{
10
    /**
11
     * @var OutputInterface
12
     */
13
    protected $output;
14
15
    public function __construct(OutputInterface $output)
16
    {
17
        $this->output = $output;
18
    }
19
20
    /**
21
     * Logs success message
22
     *
23
     * @param string $message
24
     *
25
     * @return void
26
     */
27
    public function logSuccess($message)
28
    {
29
        $this->output->writeln('<info>' . $message . '</info>');
30
    }
31
32
    /**
33
     * Logs error message
34
     *
35
     * @param \Exception $e
36
     *
37
     * @return void
38
     */
39
    public function logError(\Exception $e)
40
    {
41
        $this->output->writeln('<error>' . $e->getMessage() . '</error>');
42
    }
43
44
    /**
45
     * Logs a message
46
     *
47
     * @param string $message
48
     *
49
     * @return void
50
     */
51
    public function log($message)
52
    {
53
        $this->output->writeln('<info>' . $message . '</info>');
54
    }
55
56
    /**
57
     * Logs a message in the current line
58
     *
59
     * @param string $message
60
     *
61
     * @return void
62
     */
63
    public function logInline($message)
64
    {
65
        $this->output->write($message);
66
    }
67
68
    /**
69
     * Logs meta information
70
     *
71
     * @param string $message
72
     *
73
     * @return void
74
     */
75
    public function logMeta($message)
76
    {
77
        $this->output->writeln($message);
78
    }
79
}
80