CreateToken   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 44
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A getColumn() 0 4 1
A toString() 0 4 1
A getBinding() 0 4 1
1
<?php
2
3
namespace Hgraca\MicroDbal\Crud\QueryBuilder\Sql;
4
5
final class CreateToken
6
{
7
    const BINDING_PREFIX = ':c';
8
9
    /**
10
     * @var string
11
     */
12
    private $column;
13
14
    /**
15
     * @var mixed
16
     */
17
    private $value;
18
19
    /**
20
     * @var int
21
     */
22
    private $bindingNumber;
23
24 12
    public function __construct(
25
        string $column,
26
        $value,
27
        int $bindingCounter
28
    ) {
29 12
        $this->column = $column;
30 12
        $this->value = $value;
31 12
        $this->bindingNumber = $bindingCounter;
32 12
    }
33
34 6
    public function getColumn(): string
35
    {
36 6
        return $this->column;
37
    }
38
39 7
    public function toString(): string
40
    {
41 7
        return self::BINDING_PREFIX . $this->bindingNumber;
42
    }
43
44 7
    public function getBinding(): array
45
    {
46 7
        return [self::BINDING_PREFIX . $this->bindingNumber => $this->value];
47
    }
48
}
49