ToolTittleOutputWriter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A writeTitle() 0 6 1
1
<?php
2
3
namespace PhpGitHooks\Module\Git\Infrastructure\OutputWriter;
4
5
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
6
use Symfony\Component\Console\Output\OutputInterface;
7
8
class ToolTittleOutputWriter
9
{
10
    /**
11
     * @var OutputInterface
12
     */
13
    private $output;
14
15
    /**
16
     * ToolTittleOutputWriter constructor.
17
     *
18
     * @param OutputInterface $output
19
     */
20
    public function __construct(OutputInterface $output)
21
    {
22
        $this->output = $output;
23
    }
24
25
    /**
26
     * @param string $title
27
     */
28
    public function writeTitle($title)
29
    {
30
        $style = new OutputFormatterStyle('white', 'blue', ['bold', 'blink']);
31
        $this->output->getFormatter()->setStyle('custom', $style);
32
        $this->output->writeln(sprintf('<custom>%s</custom>', $title));
33
    }
34
}
35