Completed
Pull Request — master (#138)
by Loïc
02:53
created

CreateProgressBar::createProgressBar()   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
namespace App\Command\Helper;
13
14
use Symfony\Component\Console\Helper\ProgressBar;
15
use Symfony\Component\Console\Output\OutputInterface;
16
17
trait CreateProgressBar
18
{
19
    /**
20
     * @param OutputInterface $output
21
     * @param int             $length
22
     *
23
     * @return ProgressBar
24
     */
25
    private function createProgressBar(OutputInterface $output, $length = 10)
0 ignored issues
show
Best Practice introduced by
Using PHP4-style constructors that are named like the class is not recommend; better use the more explicit __construct method.
Loading history...
26
    {
27
        $progress = new ProgressBar($output);
28
        $progress->setBarCharacter('<info>░</info>');
29
        $progress->setEmptyBarCharacter(' ');
30
        $progress->setProgressCharacter('<comment>░</comment>');
31
32
        $progress->start($length);
33
34
        return $progress;
35
    }
36
}
37