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...
20
{
21
/**
22
* @var QueryModifier[]
23
*/
24
private $children;
25
26
/**
27
* Construct it with one or more instances of QueryModifier.
28
*/
29
public function __construct()
30
{
31
// NEXT_MAJOR: use variable-length argument lists (...$children)
32
$this->children = func_get_args();
33
}
34
35
/**
36
* @param QueryBuilder $qb
37
* @param string $dqlAlias
38
*/
39
public function modify(QueryBuilder $qb, $dqlAlias)
40
{
41
foreach ($this->children as $child) {
42
if (!$child instanceof QueryModifier) {
43
throw new InvalidArgumentException(sprintf(
44
'Child passed to QueryModifierCollection must be an instance of %s, but instance of %s found',
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.