Test Failed
Pull Request — master (#33)
by Serhii
04:22 queued 46s
created

ProgressReportable::progressBar()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 2
nc 1
nop 0
crap 6
1
<?php
2
3
namespace Matchish\ScoutElasticSearch;
4
5
use Symfony\Component\Console\Output\NullOutput;
6
use Symfony\Component\Console\Helper\ProgressBar;
7
8
trait ProgressReportable
9
{
10
    private $progressBar;
11
12
    public function withProgressReport(ProgressBar $progressBar)
13
    {
14
        $this->progressBar = $progressBar;
15
    }
16
17
    private function progressBar(): ProgressBar
18
    {
19
        return $this->progressBar ?: new ProgressBar(new NullOutput());
20
    }
21
}
22