Code Duplication    Length = 12-15 lines in 2 locations

src/Service/Game.php 1 location

@@ 615-626 (lines=12) @@
612
     *
613
     * @return Array of PlaygroundGame\Entity\Game
614
     */
615
    public function getPrizeCategoryGames($categoryid)
616
    {
617
        $em = $this->serviceLocator->get('doctrine.entitymanager.orm_default');
618
619
        $query = $em->createQuery('SELECT g FROM PlaygroundGame\Entity\Game g
620
            WHERE (g.prizeCategory = :categoryid AND g.broadcastPlatform = 1)
621
            ORDER BY g.publicationDate DESC');
622
        $query->setParameter('categoryid', $categoryid);
623
        $games = $query->getResult();
624
625
        return $games;
626
    }
627
628
    public function checkGame($identifier, $checkIfStarted = true)
629
    {

src/Service/Quiz.php 1 location

@@ 455-469 (lines=15) @@
452
        return $quiz;
453
    }
454
455
    public function getNumberCorrectAnswersQuiz($user, $count = 'count')
456
    {
457
        $em = $this->serviceLocator->get('doctrine.entitymanager.orm_default');
458
459
        $query = $em->createQuery(
460
            "SELECT COUNT(e.id) FROM PlaygroundGame\Entity\Entry e, PlaygroundGame\Entity\Game g
461
                WHERE e.user = :user
462
                AND g.classType = 'quiz'
463
                AND e.points > 0"
464
        );
465
        $query->setParameter('user', $user);
466
        $number = $query->getSingleScalarResult();
467
468
        return $number;
469
    }
470
471
    public function createQuizReply($data, $game, $user)
472
    {