Completed
Push — master ( 68be21...073c54 )
by Kévin
02:41
created

Pomm   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 39
wmc 4
lcom 1
cbo 3
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A supports() 0 6 1
A createVisitor() 0 4 1
A getExecutorTraits() 0 7 1
A getOperators() 0 4 1
1
<?php
2
3
namespace RulerZ\Target\Pomm;
4
5
use PommProject\ModelManager\Model\Model as PommModel;
6
7
use RulerZ\Compiler\Context;
8
use RulerZ\Target\AbstractSqlTarget;
9
10
class Pomm extends AbstractSqlTarget
11
{
12
    /**
13
     * @inheritDoc
14
     */
15
    public function supports($target, $mode)
16
    {
17
        // we make the assumption that pomm models use at least the
18
        // \PommProject\ModelManager\Model\ModelTrait\ReadQueries trait
19
        return $target instanceof PommModel;
20
    }
21
22
    /**
23
     * @inheritDoc
24
     */
25
    protected function createVisitor(Context $context)
26
    {
27
        return new PommVisitor($context, $this->getOperators(), $this->allowStarOperator);
28
    }
29
30
    /**
31
     * @inheritDoc
32
     */
33
    protected function getExecutorTraits()
34
    {
35
        return [
36
            '\RulerZ\Executor\Pomm\FilterTrait',
37
            '\RulerZ\Executor\Polyfill\FilterBasedSatisfaction',
38
        ];
39
    }
40
41
    /**
42
     * @inheritDoc
43
     */
44
    public function getOperators()
45
    {
46
        return PommOperators::create(parent::getOperators());
47
    }
48
}
49