Output   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 32
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A write() 0 4 1
A stripFileName() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the dotfiles project.
7
 *
8
 *     (c) Anthonius Munthi <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Dotfiles\Core\Console;
15
16
use Dotfiles\Core\Config\Config;
17
use Symfony\Component\Console\Output\ConsoleOutput;
18
19
class Output extends ConsoleOutput
20
{
21
    /**
22
     * @var Config
23
     */
24
    private $config;
25
26
    public function __construct(Config $config)
27
    {
28
        parent::__construct();
29
        $this->config = $config;
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function write($messages, $newline = false, $options = \Symfony\Component\Console\Output\Output::OUTPUT_NORMAL): void
36
    {
37
        $messages = $this->stripFileName($messages);
38
        parent::write($messages, $newline, $options);
39
    }
40
41
    /**
42
     * Strip long filename to be shorter.
43
     *
44
     * @param string $messages
45
     *
46
     * @return string
47
     */
48
    private function stripFileName(string $messages): string
49
    {
50
        return $messages;
51
    }
52
}
53