Code Duplication    Length = 18-18 lines in 2 locations

lib/Doctrine/ORM/Query.php 1 location

@@ 374-391 (lines=18) @@
371
        $this->_em->getCache()->evictEntityRegion($className);
372
    }
373
374
    private function getAllDiscriminators(ClassMetadata $classMetadata)
375
    {
376
        // FIXME: this code is copied from SqlWalker->getAllDiscriminators()
377
        $hierarchyClasses = $classMetadata->subClasses;
378
        $hierarchyClasses[] = $classMetadata->name;
379
380
        $discriminators = [];
381
        foreach ($hierarchyClasses as $class) {
382
            $currentMetadata = $this->getEntityManager()->getClassMetadata($class);
383
            $currentDiscriminator = $currentMetadata->discriminatorValue;
384
385
            if (null !== $currentDiscriminator) {
386
                $discriminators[$currentDiscriminator] = null;
387
            }
388
        }
389
390
        return $discriminators;
391
    }
392
393
    /**
394
     * Processes query parameter mappings.

lib/Doctrine/ORM/Query/SqlWalker.php 1 location

@@ 2305-2322 (lines=18) @@
2302
        return '(' . implode(', ', $sqlParameterList) . ')';
2303
    }
2304
2305
    private function getAllDiscriminators(ClassMetadata $classMetadata)
2306
    {
2307
        // FIXME: this code is identical to Query->getAllDiscriminators()
2308
        $hierarchyClasses = $classMetadata->subClasses;
2309
        $hierarchyClasses[] = $classMetadata->name;
2310
2311
        $discriminators = [];
2312
        foreach ($hierarchyClasses as $class) {
2313
            $currentMetadata = $this->em->getClassMetadata($class);
2314
            $currentDiscriminator = $currentMetadata->discriminatorValue;
2315
2316
            if (null !== $currentDiscriminator) {
2317
                $discriminators[$currentDiscriminator] = null;
2318
            }
2319
        }
2320
2321
        return $discriminators;
2322
    }
2323
}
2324