| Total Complexity | 3 |
| Total Lines | 44 |
| Duplicated Lines | 77.27 % |
| Changes | 0 | ||
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:
| 1 | <?php |
||
| 11 | final class GH6699Test extends OrmFunctionalTestCase |
||
| 12 | { |
||
| 13 | protected function setUp() : void |
||
| 18 | } |
||
| 19 | |||
| 20 | View Code Duplication | public function testMixedParametersWithZeroNumber() : void |
|
| 21 | { |
||
| 22 | $query = $this->_em->createQueryBuilder() |
||
|
|
|||
| 23 | ->select('u') |
||
| 24 | ->from(CmsUser::class, 'u') |
||
| 25 | ->andWhere('u.username = :username') |
||
| 26 | ->andWhere('u.id = ?0') |
||
| 27 | ->getQuery(); |
||
| 28 | |||
| 29 | $query->setParameter('username', 'bar'); |
||
| 30 | $query->setParameter(0, 0); |
||
| 31 | |||
| 32 | $query->execute(); |
||
| 33 | |||
| 34 | self::assertCount(2, $query->getParameters()); |
||
| 35 | self::assertSame(0, $query->getParameter(0)->getValue()); |
||
| 36 | self::assertSame('bar', $query->getParameter('username')->getValue()); |
||
| 37 | } |
||
| 38 | |||
| 39 | View Code Duplication | public function testMixedParametersWithZeroNumberOnQueryBuilder() : void |
|
| 55 | } |
||
| 56 | } |
||
| 57 |