Completed
Pull Request — master (#138)
by Loïc
04:36 queued 01:35
created

CreateProgressBar   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createProgressBar() 0 11 1
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