Completed
Push — master ( fef7a6...aff413 )
by Arne
02:38
created

AbstractCommand::getConfiguration()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 18
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.2
c 0
b 0
f 0
cc 4
eloc 8
nc 4
nop 1
1
<?php
2
3
namespace Archivr\Cli\Command;
4
5
use Symfony\Component\Console\Command\Command;
6
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
abstract class AbstractCommand extends Command
11
{
12
    /**
13
     * @var InputInterface
14
     */
15
    protected $input;
16
17
    /**
18
     * @var OutputInterface
19
     */
20
    protected $output;
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    protected function execute(InputInterface $input, OutputInterface $output)
26
    {
27
        $this->input = $input;
28
        $this->output = $output;
29
30
        $this->registerFormatters();
31
    }
32
33
    /**
34
     * Registers some custom formatters to the given output.
35
     */
36
    protected function registerFormatters(): void
37
    {
38
        $this->output->getFormatter()->setStyle('bold', new OutputFormatterStyle(null, null, ['bold']));
39
    }
40
}
41