GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#27)
by Simone
12:46 queued 07:49
created

QueryBuilderFactory   F

Complexity

Total Complexity 94

Size/Duplication

Total Lines 560
Duplicated Lines 21.96 %

Test Coverage

Coverage 0.76%

Importance

Changes 0
Metric Value
dl 123
loc 560
ccs 2
cts 262
cp 0.0076
rs 1.5789
c 0
b 0
f 0
wmc 94

30 Methods

Rating   Name   Duplication   Size   Complexity  
A setFilters() 0 5 1
A getFields() 0 9 2
A storeJoin() 0 4 1
A getFilters() 0 3 1
A noExistsJoin() 0 9 2
A setOrFilters() 0 5 1
A getOrFilters() 0 3 1
A setSorting() 0 5 1
A setFields() 0 5 1
A getPrinting() 0 3 1
B join() 0 48 5
A setRelationEntityAlias() 0 3 1
A getSelect() 0 3 1
C sort() 0 38 8
A getRel() 0 3 1
A buildSelectValue() 0 9 2
A setPageLength() 0 5 1
A getRelationEntityAlias() 0 3 1
D filter() 0 37 9
A getPageLength() 0 3 1
A getEntityManager() 0 3 1
F applyFilterOr() 71 125 23
A setPrinting() 0 5 1
F applyFilterAnd() 52 98 20
A setRel() 0 5 1
A setPage() 0 5 1
A getPage() 0 3 1
A setSelect() 0 5 1
A getQueryBuilder() 0 9 2
A getAvailableFilters() 0 3 1

How to fix   Duplicated Code    Complexity   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

Complex Class

 Tip:   Before tackling complexity, make sure that you eliminate any duplication first. This often can reduce the size of classes significantly.

Complex classes like QueryBuilderFactory often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use QueryBuilderFactory, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace Mado\QueryBundle\Queries;
4
5
use Mado\QueryBundle\Objects\FilteringObject;
6
use Mado\QueryBundle\Vocabulary\Operators;
7
8
class QueryBuilderFactory extends AbstractQuery
9
{
10
    const DIRECTION_AZ = 'asc';
11
12
    const DIRECTION_ZA = 'desc';
13
14
    /**
15
     * @var QueryBuilder
16
     */
17
    protected $qBuilder;
18
19
    protected $fields;
20
21
    protected $filtering;
22
23
    protected $orFiltering;
24
25
    protected $relationEntityAlias;
26
27
    protected $sorting;
28
29
    protected $joins;
30
31
    protected $rel;
32
33
    protected $printing;
34
35
    protected $page;
36
37
    protected $pageLength;
38
39
    protected $select;
40
41 1
    public function getAvailableFilters()
42
    {
43 1
        return array_keys(Operators::getAll());
44
    }
45
46
    public function setFields(array $fields = [])
47
    {
48
        $this->fields = $fields;
49
50
        return $this;
51
    }
52
53
    public function getFields()
54
    {
55
        if (null === $this->fields) {
56
            throw new \RuntimeException(
57
                'Oops! Fields are not defined'
58
            );
59
        }
60
61
        return $this->fields;
62
    }
63
64
    public function setFilters(array $filtering = [])
65
    {
66
        $this->filtering = $filtering;
67
68
        return $this;
69
    }
70
71
    public function setOrFilters(array $orFiltering = [])
72
    {
73
        $this->orFiltering = $orFiltering;
74
75
        return $this;
76
    }
77
78
    public function setSorting(array $sorting = [])
79
    {
80
        $this->sorting = $sorting;
81
82
        return $this;
83
    }
84
85
    public function getFilters()
86
    {
87
        return $this->filtering;
88
    }
89
90
    public function getOrFilters()
91
    {
92
        return $this->orFiltering;
93
    }
94
95
    private function noExistsJoin($prevEntityAlias, $currentEntityAlias)
96
    {
97
        if (null === $this->joins) {
98
            $this->joins = [];
99
        }
100
101
        $needle = $prevEntityAlias . "_" . $currentEntityAlias;
102
103
        return ! in_array($needle, $this->joins);
104
    }
105
106
    private function storeJoin($prevEntityAlias, $currentEntityAlias)
107
    {
108
        $needle = $prevEntityAlias . "_" . $currentEntityAlias;
109
        $this->joins[$needle] = $needle;
110
    }
111
112
    /**
113
     * @param String $relation Nome della relazione semplice (groups.name) o con embedded (_embedded.groups.name)
114
     * @return $this
115
     */
116
    public function join(String $relation)
117
    {
118
        $relation = explode('|', $relation)[0];
119
        $relations = [$relation];
120
121
        if (strstr($relation, '_embedded.')) {
122
            $embeddedFields = explode('.', $relation);
123
124
            // elimino l'ultimo elemento che dovrebbe essere il nome del campo
125
            unset($embeddedFields[count($embeddedFields) - 1]);
126
127
            // elimino il primo elemento _embedded
128
            unset($embeddedFields[0]);
129
130
            $relations = $embeddedFields;
131
        }
132
133
        $entityName = $this->getEntityName();
134
        $entityAlias = $this->entityAlias;
135
136
        foreach ($relations as $relation) {
137
138
            $relation = $this->parser->camelize($relation);
139
            $relationEntityAlias = 'table_' . $relation;
140
141
            $metadata = $this->manager->getClassMetadata($entityName);
142
143
            if ($metadata->hasAssociation($relation)) {
144
145
                $association = $metadata->getAssociationMapping($relation);
146
147
                $fieldName = $this->parser->camelize($association['fieldName']);
148
149
                if ($this->noExistsJoin($relationEntityAlias, $relation)) {
150
151
                    $this->qBuilder
152
                            ->join($entityAlias . "." . $fieldName, $relationEntityAlias);
153
154
                    $this->storeJoin($relationEntityAlias, $relation);
155
                }
156
                $entityName = $association['targetEntity'];
157
                $entityAlias = $relationEntityAlias;
158
            }
159
160
            $this->setRelationEntityAlias($relationEntityAlias);
161
        }
162
163
        return $this;
164
    }
165
166
    public function filter()
167
    {
168
        if (null === $this->filtering) {
169
            throw new \RuntimeException(
170
                'Oops! Filtering is not defined'
171
            );
172
        }
173
174
        if (!$this->fields) {
175
            throw new \RuntimeException(
176
                'Oops! Fields are not defined'
177
            );
178
        }
179
180
        foreach ($this->filtering as $filter => $value) {
181
            $this->applyFilterAnd($filter, $value);
182
        }
183
184
        if (null !== $this->orFiltering) {
185
            $orFilter = [];
186
            $orFilter['orCondition'] = null;
187
            $orFilter['parameters'] = [];
188
189
            foreach ($this->orFiltering as $filter => $value) {
190
                $orFilter = $this->applyFilterOr($filter, $value, $orFilter);
191
            }
192
193
            if ((count($orFilter) > 0) && ($orFilter['orCondition'] != null)) {
194
                $this->qBuilder->andWhere($orFilter['orCondition']);
195
196
                foreach ($orFilter['parameters'] as $parameter) {
197
                    $this->qBuilder->setParameter($parameter['field'], $parameter['value']);
198
                }
199
            }
200
        }
201
202
        return $this;
203
    }
204
205
    private function applyFilterAnd($filter, $value)
206
    {
207
        $whereCondition = null;
208
        $filtering = FilteringObject::fromFilter($filter);
209
        $fieldName = $this->parser->camelize($filtering->getFieldName());
210
211
        $operator = Operators::getDefaultOperator();
212
        if($filtering->hasOperator()){
213
            $operator = Operators::get($filtering->getOperator());
214
        }
215
216
        // controllo se il filtro che mi arriva dalla richiesta è una proprietà di questa entità
217
        // esempio per users: filtering[username|contains]=mado
218
        if (in_array($fieldName, $this->fields)) {
219
220
            $salt = '';
221 View Code Duplication
            foreach ($this->qBuilder->getParameters() as $parameter) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
222
                if ($parameter->getName() == 'field_' . $fieldName) {
223
                    $salt = '_' . rand(111, 999);
224
                }
225
            }
226
227 View Code Duplication
            if ($filtering->hasOperator()) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
228
                if ('list' == $filtering->getOperator()) {
229
                    $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')';
230
                } else if ('field_eq' == $filtering->getOperator()) {
231
                    $whereCondition =
232
                        $this->entityAlias . '.' . $fieldName . ' '.
233
                        $operator['meta'] . '' .
234
                        $this->entityAlias . '.' . $value
235
                        ;
236
                } else {
237
                    $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt;
238
                }
239
            } else {
240
                $whereCondition = $this->entityAlias.'.'.$fieldName.' = :field_'.$fieldName . $salt;
241
            }
242
243
            $this->qBuilder->andWhere($whereCondition);
244
245 View Code Duplication
            if (isset($operator['substitution_pattern'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
246
                if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) {
247
                    $value = explode(',', $value);
248
                } else {
249
                    $value = str_replace(
250
                        '{string}',
251
                        $value,
252
                        $operator['substitution_pattern']
253
                    );
254
                }
255
            }
256
257
            $this->qBuilder->setParameter('field_' . $fieldName . $salt, $value);
258
        } else {
259
            $isNotARelation = 0 !== strpos($fieldName, 'Embedded.');
260
            if ($isNotARelation) {
261
                $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' ' . $this->entityAlias . '.' . $value;
262
                $this->qBuilder->andWhere($whereCondition);
263
            }
264
        }
265
266
        // controllo se il filtro si riferisce ad una relazione dell'entità quindi devo fare dei join
267
        // esempio per users: filtering[_embedded.groups.name|eq]=admin
268
        if (strstr($filter, '_embedded.')) {
269
270
            $this->join($filter);
271
            $relationEntityAlias = $this->getRelationEntityAlias();
272
273
            $embeddedFields = explode('.', $fieldName);
274
            $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields)-1]);
275
276
            $salt = '';
277 View Code Duplication
            foreach ($this->qBuilder->getParameters() as $parameter) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
278
                if ($parameter->getName() == 'field_' . $fieldName) {
279
                    $salt = '_' . rand(111, 999);
280
                }
281
            }
282
283 View Code Duplication
            if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
284
                $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')';
285
            } else {
286
                $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt;
287
            }
288
289
            $this->qBuilder->andWhere($whereCondition);
290 View Code Duplication
            if (isset($operator['substitution_pattern'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
291
                if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) {
292
                    $value = explode(',', $value);
0 ignored issues
show
Bug introduced by
It seems like $value can also be of type array; however, parameter $string of explode() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

292
                    $value = explode(',', /** @scrutinizer ignore-type */ $value);
Loading history...
293
                } else {
294
                    $value = str_replace(
295
                        '{string}',
296
                        $value,
297
                        $operator['substitution_pattern']
298
                    );
299
                }
300
            }
301
302
            $this->qBuilder->setParameter('field_' . $fieldName . $salt, $value);
303
        }
304
    }
305
306
    private function applyFilterOr($filter, $value, $orCondition)
307
    {
308
        $whereCondition = null;
309
        $filtering = FilteringObject::fromFilter($filter);
310
311
        $fieldName = $this->parser->camelize($filtering->getFieldName());
312
313
        $operator = Operators::getDefaultOperator();
314
        if($filtering->hasOperator()) {
315
            $operator = Operators::get($filtering->getOperator());
316
        }
317
318
        // controllo se il filtro che mi arriva dalla richiesta è una proprietà di questa entità
319
        // esempio per users: filtering[username|contains]=mado
320
        if (in_array($fieldName, $this->fields)) {
321
322
            $salt = '';
323 View Code Duplication
            foreach ($this->qBuilder->getParameters() as $parameter) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
324
                if ($parameter->getName() == 'field_' . $fieldName) {
325
                    $salt = '_' . rand(111, 999);
326
                }
327
            }
328
329 View Code Duplication
            if ($filtering->hasOperator()) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
330
                if ('list' == $filtering->getOperator()) {
331
                    $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')';
332
                } else if ('field_eq' == $filtering->getOperator()) {
333
                    $whereCondition =
334
                        $this->entityAlias . '.' . $fieldName . ' '.
335
                        $operator['meta'] . '' .
336
                        $this->entityAlias . '.' . $value
337
                    ;
338
                    //} else {
339
                    //throw new \RuntimeException(
340
                    //'Oops! Eccezzione'
341
                    //);
342
                } else {
343
                    $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt;
344
                }
345
            } else {
346
                $whereCondition = $this->entityAlias.'.'.$fieldName.' = :field_'.$fieldName . $salt;
347
            }
348
349 View Code Duplication
            if ($orCondition['orCondition'] != null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
350
                $orCondition['orCondition'] .= ' OR ' . $whereCondition;
351
            } else {
352
                $orCondition['orCondition'] = $whereCondition;
353
            }
354
355 View Code Duplication
            if (isset($operator['substitution_pattern'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
356
                if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) {
357
                    $value = explode(',', $value);
358
                } else {
359
                    $value = str_replace(
360
                        '{string}',
361
                        $value,
362
                        $operator['substitution_pattern']
363
                    );
364
                }
365
            }
366
367
            $orCondition['parameters'][] = [
368
                'field' => 'field_' . $fieldName . $salt,
369
                'value' => $value
370
            ];
371
        } else {
372
            $isNotARelation = 0 !== strpos($fieldName, 'Embedded.');
373
            if ($isNotARelation) {
374
                $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' ' . $this->entityAlias . '.' . $value;
375 View Code Duplication
                if ($orCondition['orCondition'] != null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
376
                    $orCondition['orCondition'] .= ' OR ' . $whereCondition;
377
                } else {
378
                    $orCondition['orCondition'] = $whereCondition;
379
                }
380
            }
381
        }
382
383
        // controllo se il filtro si riferisce ad una relazione dell'entità quindi devo fare dei join
384
        // esempio per users: filtering[_embedded.groups.name|eq]=admin
385
        if (strstr($filter, '_embedded.')) {
386
387
            $this->join($filter);
388
            $relationEntityAlias = $this->getRelationEntityAlias();
389
390
            $embeddedFields = explode('.', $fieldName);
391
            $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields)-1]);
392
393
            $salt = '';
394 View Code Duplication
            foreach ($this->qBuilder->getParameters() as $parameter) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
395
                if ($parameter->getName() == 'field_' . $fieldName) {
396
                    $salt = '_' . rand(111, 999);
397
                }
398
            }
399
400 View Code Duplication
            if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
401
                $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')';
402
            } else {
403
                $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt;
404
            }
405
406 View Code Duplication
            if ($orCondition['orCondition'] != null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
407
                $orCondition['orCondition'] .= ' OR ' . $whereCondition;
408
            } else {
409
                $orCondition['orCondition'] = $whereCondition;
410
            }
411
412 View Code Duplication
            if (isset($operator['substitution_pattern'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
413
                if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) {
414
                    $value = explode(',', $value);
0 ignored issues
show
Bug introduced by
It seems like $value can also be of type array; however, parameter $string of explode() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

414
                    $value = explode(',', /** @scrutinizer ignore-type */ $value);
Loading history...
415
                } else {
416
                    $value = str_replace(
417
                        '{string}',
418
                        $value,
419
                        $operator['substitution_pattern']
420
                    );
421
                }
422
            }
423
424
            $orCondition['parameters'][] = [
425
                'field' => 'field_' . $fieldName . $salt,
426
                'value' => $value
427
            ];
428
        }
429
430
        return $orCondition;
431
    }
432
433
    public function sort()
434
    {
435
        if (!$this->fields) {
436
            throw new \RuntimeException(
437
                'Oops! Fields are not defined'
438
            );
439
        }
440
441
        if (null === $this->sorting) {
442
            throw new \RuntimeException(
443
                'Oops! Sorting is not defined'
444
            );
445
        }
446
447
        foreach ($this->sorting as $sort => $val) {
448
            $val = strtolower($val);
449
450
            $fieldName = $this->parser->camelize($sort);
451
452
            if (in_array($fieldName, $this->fields)) {
453
                $direction = ($val === self::DIRECTION_AZ) ? self::DIRECTION_AZ : self::DIRECTION_ZA;
454
                $this->qBuilder->addOrderBy($this->entityAlias .'.'. $fieldName, $direction);
455
            }
456
457
            if (strstr($sort, '_embedded.')) {
458
                $this->join($sort);
459
                $relationEntityAlias = $this->getRelationEntityAlias();
460
461
                $embeddedFields = explode('.', $sort);
462
                $fieldName = $this->parser->camelize($embeddedFields[2]);
463
                $direction = ($val === self::DIRECTION_AZ) ? self::DIRECTION_AZ : self::DIRECTION_ZA;
464
465
                $this->qBuilder->addOrderBy($relationEntityAlias.'.'.$fieldName, $direction);
466
            }
467
468
        }
469
470
        return $this;
471
    }
472
473
    public function getQueryBuilder()
474
    {
475
        if (!$this->qBuilder) {
476
            throw new \RuntimeException(
477
                "Oops! Query builder was never initialized! call ::createQueryBuilder('entityName', 'alias') to start."
478
            );
479
        }
480
481
        return $this->qBuilder;
482
    }
483
484
    public function buildSelectValue() : string
485
    {
486
        if ("" == $this->getSelect()) {
487
            return $this->getEntityAlias(
0 ignored issues
show
Bug introduced by
The method getEntityAlias() does not exist on Mado\QueryBundle\Queries\QueryBuilderFactory. Did you maybe mean getEntityName()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

487
            return $this->/** @scrutinizer ignore-call */ getEntityAlias(

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
488
                $this->getEntityName()
489
            );
490
        }
491
492
        return $this->getSelect();
493
    }
494
495
    private function setRelationEntityAlias(string $relationEntityAlias)
496
    {
497
        $this->relationEntityAlias = $relationEntityAlias;
498
    }
499
500
    private function getRelationEntityAlias()
501
    {
502
        return $this->relationEntityAlias;
503
    }
504
505
    public function setRel($rel)
506
    {
507
        $this->rel = $rel;
508
509
        return $this;
510
    }
511
512
    public function getRel()
513
    {
514
        return $this->rel;
515
    }
516
517
    public function setPrinting($printing)
518
    {
519
        $this->printing = $printing;
520
521
        return $this;
522
    }
523
524
    public function getPrinting()
525
    {
526
        return $this->printing;
527
    }
528
529
    public function setPage($page)
530
    {
531
        $this->page = $page;
532
533
        return $this;
534
    }
535
536
    public function getPage()
537
    {
538
        return $this->page;
539
    }
540
541
    public function setPageLength($pageLength)
542
    {
543
        $this->pageLength = $pageLength;
544
545
        return $this;
546
    }
547
548
    public function getPageLength()
549
    {
550
        return $this->pageLength;
551
    }
552
553
    public function setSelect(string $select) : QueryBuilderFactory
554
    {
555
        $this->select = $select;
556
557
        return $this;
558
    }
559
560
    public function getSelect()
561
    {
562
        return $this->select;
563
    }
564
565
    public function getEntityManager()
566
    {
567
        return $this->manager;
568
    }
569
}
570