Failed Conditions
Pull Request — experimental/3.1 (#2285)
by Kiyotaka
41:31
created

WhereCustomizer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A customize() 0 6 2
createStatements() 0 1 ?
1
<?php
2
3
4
namespace Eccube\Doctrine\Query;
5
6
7
use Doctrine\ORM\QueryBuilder;
8
9
abstract class WhereCustomizer implements QueryCustomizer
0 ignored issues
show
introduced by
Abstract class name is not prefixed with "Abstract"
Loading history...
introduced by
Missing class doc comment
Loading history...
10
{
11
12
    /**
13
     * @param QueryBuilder $builder
14
     * @param array $params
0 ignored issues
show
introduced by
Expected 8 spaces after parameter type; 1 found
Loading history...
15
     * @param string $queryKey
0 ignored issues
show
introduced by
Expected 7 spaces after parameter type; 1 found
Loading history...
16
     */
17
    public final function customize(QueryBuilder $builder, $params, $queryKey)
0 ignored issues
show
Coding Style introduced by
As per PSR2, final should precede the visibility keyword.
Loading history...
18
    {
19
        foreach ($this->createStatements($params, $queryKey) as $whereClause) {
20
            $whereClause->build($builder);
21
        }
22
    }
23
24
    /**
25
     * @param array $params
26
     * @param $queryKey
27
     * @return WhereClause[]
28
     */
29
    protected abstract function createStatements($params, $queryKey);
0 ignored issues
show
Coding Style introduced by
The abstract declaration must precede the visibility declaration
Loading history...
30
}