Passed
Pull Request — master (#400)
by Théo
03:15
created

OutputFormatterConfigurator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 9
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the box project.
7
 *
8
 * (c) Kevin Herrera <[email protected]>
9
 *     Théo Fidry <[email protected]>
10
 *
11
 * This source file is subject to the MIT license that is bundled
12
 * with this source code in the file LICENSE.
13
 */
14
15
namespace KevinGH\Box\Console;
16
17
use KevinGH\Box\NotInstantiable;
18
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
19
use Symfony\Component\Console\Output\OutputInterface;
20
21
/**
22
 * Utility to configure the output formatter styles.
23
 *
24
 * @private
25
 */
26
final class OutputFormatterConfigurator
27
{
28
    use NotInstantiable;
29
30
    public static function configure(OutputInterface $output): void
31
    {
32
        $outputFormatter = $output->getFormatter();
33
34
        $outputFormatter->setStyle(
35
            'recommendation',
36
            new OutputFormatterStyle('black', 'yellow')
37
        );
38
        $outputFormatter->setStyle(
39
            'warning',
40
            new OutputFormatterStyle('white', 'red')
41
        );
42
    }
43
}
44