Completed
Push — master ( 3b5f38...c5ceed )
by Tomáš
04:59
created

ShowProgress   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 32
ccs 0
cts 16
cp 0
rs 10
c 3
b 0
f 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A init() 0 4 1
A advance() 0 4 1
A finish() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of Symplify
5
 * Copyright (c) 2016 Tomas Votruba (http://tomasvotruba.cz).
6
 */
7
8
namespace Symplify\PHP7_CodeSniffer\Console\Progress;
9
10
use Symfony\Component\Console\Helper\ProgressBar;
11
use Symfony\Component\Console\Output\OutputInterface;
12
13
final class ShowProgress
14
{
15
    /**
16
     * @var OutputInterface
17
     */
18
    private $output;
19
20
    /**
21
     * @var ProgressBar
22
     */
23
    private $progressBar;
24
25
    public function __construct(OutputInterface $output)
26
    {
27
        $this->output = $output;
28
    }
29
30
    public function init(int $stepCount)
31
    {
32
        $this->progressBar = new ProgressBar($this->output, $stepCount);
33
    }
34
35
    public function advance()
36
    {
37
        $this->progressBar->advance();
38
    }
39
40
    public function finish()
41
    {
42
        $this->progressBar->finish();
43
    }
44
}
45