WarmUpLiveReporter::finish()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace whm\Smoke\Extensions\SmokeReporter\Reporter;
4
5
use Symfony\Component\Console\Output\OutputInterface;
6
7
class WarmUpLiveReporter implements Reporter
8
{
9
    /**
10
     * @var OutputInterface
11
     */
12
    private $output;
13
    private $urlCount = 0;
14
15
    public function init(OutputInterface $_output)
16
    {
17
        $this->output = $_output;
18
    }
19
20
    public function processResults($results)
21
    {
22
        if (count($results) > 0) {
23
            ++$this->urlCount;
24
            $firstResult = array_pop($results);
25
            $this->output->writeln('   ' . (string) $firstResult->getResponse()->getUri());
26
            $this->output->writeln('');
27
        }
28
    }
29
30
    public function finish()
31
    {
32
        $this->output->writeln('   <comment>Warm up finished. ' . $this->urlCount . ' urls visited.</comment>');
33
        $this->output->writeln('');
34
    }
35
}
36