Count   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 19
c 0
b 0
f 0
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getSelectPart() 0 7 2
1
<?php
2
3
namespace Xsolve\SalesforceClient\QueryBuilder\Expr\Select;
4
5
use Xsolve\SalesforceClient\QueryBuilder\Expr\ExprInterface;
6
7
class Count extends AbstractSelect implements ExprInterface
8
{
9
    /**
10
     * @var string|null
11
     */
12
    private $countedValue;
13
14 2
    public function __construct(string $countedValue = null)
15
    {
16 2
        $this->countedValue = $countedValue;
17 2
    }
18
19 46
    protected function getSelectPart(): string
20
    {
21 46
        if (null !== $this->countedValue) {
22 2
            return sprintf('COUNT(%s)', $this->countedValue);
23
        }
24
25 45
        return 'COUNT()';
26
    }
27
}
28