This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
24
{
25
/**
26
* @var Filter|QueryModifier child
27
*/
28
private $child;
29
30
/**
31
* @param Filter|QueryModifier $child
32
*/
33
public function __construct($child)
34
{
35
$this->child = $child;
36
}
37
38
/**
39
* @param QueryBuilder $qb
40
* @param string $dqlAlias
41
*
42
* @return string
43
*/
44
public function getFilter(QueryBuilder $qb, $dqlAlias)
45
{
46
$qb->select(sprintf('COUNT(%s)', $dqlAlias));
47
48
if ($this->child instanceof Filter) {
49
return $this->child->getFilter($qb, $dqlAlias);
50
}
51
52
return '';
53
}
54
55
/**
56
* @param QueryBuilder $qb
57
* @param string $dqlAlias
58
*/
59
public function modify(QueryBuilder $qb, $dqlAlias)
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.