Completed
Push — master ( 2044f4...a35418 )
by Loïc
13s queued 11s
created

ProgressBarCreator::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
/*
4
 * This file is part of monofony.
5
 *
6
 * (c) Mobizel
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
declare(strict_types=1);
13
14
namespace App\Command\Helper;
15
16
use Symfony\Component\Console\Helper\ProgressBar;
17
use Symfony\Component\Console\Output\OutputInterface;
18
19
final class ProgressBarCreator
20
{
21
    public function create(OutputInterface $output, int $length = 10): ProgressBar
22
    {
23
        $progress = new ProgressBar($output);
24
        $progress->setBarCharacter('<info>░</info>');
25
        $progress->setEmptyBarCharacter(' ');
26
        $progress->setProgressCharacter('<comment>░</comment>');
27
28
        $progress->start($length);
29
30
        return $progress;
31
    }
32
}
33