Passed
Branch development (0519a2)
by Theodoros
02:02
created

ProgressBarHelper::generateProgressBar()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Econda\Business\Helper;
9
10
use Spryker\Shared\Gui\ProgressBar\ProgressBarBuilder;
0 ignored issues
show
Bug introduced by
The type Spryker\Shared\Gui\ProgressBar\ProgressBarBuilder was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Symfony\Component\Console\Output\OutputInterface;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Console\Output\OutputInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
13
class ProgressBarHelper implements ProgressBarHelperInterface
14
{
15
16
    /** @var \Symfony\Component\Console\Helper\ProgressBar */
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Console\Helper\ProgressBar was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
    protected $progressBar;
18
19
    /**
20
     * @param \Symfony\Component\Console\Output\OutputInterface $output
21
     * @param string $resourceType
22
     * @param int $totalCount
23
     *
24
     * @return \Symfony\Component\Console\Helper\ProgressBar
25
     */
26
    public function startProgressBar(
27
        OutputInterface $output,
28
        $resourceType,
29
        $totalCount
30
    ) {
31
        $this->progressBar = $this->generateProgressBar($output, $totalCount, $resourceType);
32
        $this->progressBar->start();
33
        $this->progressBar->advance(0);
34
35
        return $this->progressBar;
36
    }
37
38
    /**
39
     * @param \Symfony\Component\Console\Output\OutputInterface $output
40
     * @param int $count
41
     * @param string $resourceType
42
     *
43
     * @return \Symfony\Component\Console\Helper\ProgressBar
44
     */
45
    protected function generateProgressBar(OutputInterface $output, $count, $resourceType)
46
    {
47
        $builder = new ProgressBarBuilder($output, $count, $resourceType);
48
        return $builder->build();
49
    }
50
51
}
52