Completed
Push — master ( 5c40ca...712b76 )
by WEBEWEB
01:59
created

AbstractCommand::displayHeader()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2018 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\CoreBundle\Command;
13
14
use Symfony\Component\Console\Command\Command;
15
use Symfony\Component\Console\Input\InputInterface;
16
use Symfony\Component\Console\Output\OutputInterface;
17
use Symfony\Component\Console\Style\StyleInterface;
18
use WBW\Bundle\CoreBundle\Helper\CommandHelper;
19
20
/**
21
 * Abstract command.
22
 *
23
 * @author webeweb <https://github.com/webeweb/>
24
 * @package WBW\Bundle\CoreBundle\Command
25
 * @abstract
26
 */
27
abstract class AbstractCommand extends Command {
28
29
    /**
30
     * Displays the header.
31
     *
32
     * @param StyleInterface $io The I/O.
33
     * @return void
34
     */
35
    protected function displayHeader(StyleInterface $io, $text) {
36
        $io->newLine();
37
        $io->text($text);
38
        $io->newLine();
39
    }
40
41
    /**
42
     * Get a checkbox.
43
     *
44
     * @param bool $checked Checked ?
45
     * @return string Returns the checkbox.
46
     */
47
    protected function getCheckbox($checked) {
48
        return CommandHelper::getCheckbox($checked);
49
    }
50
51
    /**
52
     * Create a style.
53
     *
54
     * @param InputInterface $input The input.
55
     * @param OutputInterface $output The output.
56
     * @return StyleInterface Returns the style.
57
     */
58
    protected function newStyle(InputInterface $input, OutputInterface $output) {
59
        return CommandHelper::newSymfonyStyle($input, $output);
60
    }
61
}
62