Lines 0.00% 0 / 3
Functions and Methods 0.00% 0 / 3
Classes and Traits 0.00% 0 / 1
Name Lines Functions and Methods CRAP Classes and Traits
ProgressBarProgressReporter 0.00% 0 / 3 0.00% 0 / 3 12 0.00% 0 / 1
 __construct 0.00% 0 / 1 0.00% 0 / 1 2
 setTotal 0.00% 0 / 1 0.00% 0 / 1 2
 advance 0.00% 0 / 1 0.00% 0 / 1 2
1<?php
2
3declare(strict_types=1);
4
5namespace Districts\Scraper\UI;
6
7use Districts\Scraper\Domain\ProgressReporter;
8use Symfony\Component\Console\Helper\ProgressBar;
9
10final readonly class ProgressBarProgressReporter implements ProgressReporter
11{
12    public function __construct(
13        private ProgressBar $progressBar,
14    ) {
15    }
16
17    public function setTotal(int $total): void
18    {
19        $this->progressBar->setMaxSteps($total);
20    }
21
22    public function advance(): void
23    {
24        $this->progressBar->advance();
25    }
26}