Grouping   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 24
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSelectPart() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Xsolve\SalesforceClient\QueryBuilder\Expr\Select;
4
5
use Xsolve\SalesforceClient\QueryBuilder\Expr\ExprInterface;
6
7
class Grouping extends AbstractSelect implements ExprInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $fieldName;
13
14
    /**
15
     * @var string
16
     */
17
    protected $targetName;
18
19 4
    public function __construct(string $fieldName, string $targetName)
20
    {
21 4
        $this->fieldName = $fieldName;
22 4
        $this->targetName = $targetName;
23 4
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 4
    protected function getSelectPart(): string
29
    {
30 4
        return sprintf('GROUPING(%s) %s', $this->fieldName, $this->targetName);
31
    }
32
}
33