| Total Complexity | 4 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Coverage | 59.09% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class AbstractQuery |
||
| 9 | { |
||
| 10 | protected $manager; |
||
| 11 | |||
| 12 | protected $entityName; |
||
| 13 | |||
| 14 | protected $entityAlias; |
||
| 15 | |||
| 16 | protected $parser; |
||
| 17 | |||
| 18 | protected $qBuilder; |
||
| 19 | |||
| 20 | 28 | public function __construct(EntityManager $manager) |
|
| 24 | 28 | } |
|
| 25 | |||
| 26 | public function createSelectAndGroupBy($entityName, $alias, $groupByField) |
||
| 37 | } |
||
| 38 | |||
| 39 | 6 | public function createQueryBuilder($entityName, $alias) |
|
| 40 | { |
||
| 41 | 6 | $this->entityName = $entityName; |
|
| 42 | 6 | $this->entityAlias = $alias; |
|
| 43 | |||
| 44 | 6 | $this->qBuilder = $this->manager->createQueryBuilder($this->entityName) |
|
| 45 | 6 | ->select($alias) |
|
| 46 | 6 | ->from($this->entityName, $alias); |
|
| 47 | 6 | } |
|
| 48 | |||
| 49 | 3 | public function getEntityName() |
|
| 52 | } |
||
| 53 | } |
||
| 54 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.