Grouping::getSelectPart()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 1
nc 1
nop 0
crap 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