AbstractSqlTarget   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 27
c 0
b 0
f 0
wmc 3
lcom 1
cbo 3
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A createVisitor() 0 4 1
A getOperators() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace RulerZ\Target;
6
7
use RulerZ\Compiler\Context;
8
use RulerZ\Target\Operators\Definitions;
9
use RulerZ\Target\Operators\GenericSqlDefinitions;
10
11
abstract class AbstractSqlTarget extends AbstractCompilationTarget
12
{
13
    protected $allowStarOperator = true;
14
15
    public function __construct(array $operators = [], array $inlineOperators = [], $allowStarOperator = true)
16
    {
17
        parent::__construct($operators, $inlineOperators);
18
19
        $this->allowStarOperator = $allowStarOperator;
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    protected function createVisitor(Context $context)
26
    {
27
        return new GenericSqlVisitor($context, $this->getOperators(), $this->allowStarOperator);
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function getOperators(): Definitions
34
    {
35
        return GenericSqlDefinitions::create(parent::getOperators());
36
    }
37
}
38