Completed
Branch master (c5ceed)
by Tomáš
33:54 queued 13:17
created

ShowProgress::advance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 1
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 2
b 0
f 1
cc 1
eloc 2
nc 1
nop 0
crap 2
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