Code Duplication    Length = 12-15 lines in 2 locations

src/Service/Quiz.php 1 location

@@ 494-508 (lines=15) @@
491
        return $quiz;
492
    }
493
494
    public function getNumberCorrectAnswersQuiz($user, $count = 'count')
495
    {
496
        $em = $this->serviceLocator->get('doctrine.entitymanager.orm_default');
497
498
        $query = $em->createQuery(
499
            "SELECT COUNT(e.id) FROM PlaygroundGame\Entity\Entry e, PlaygroundGame\Entity\Game g
500
                WHERE e.user = :user
501
                AND g.classType = 'quiz'
502
                AND e.points > 0"
503
        );
504
        $query->setParameter('user', $user);
505
        $number = $query->getSingleScalarResult();
506
507
        return $number;
508
    }
509
510
    public function createQuizReply($data, $game, $user)
511
    {

src/Service/Game.php 1 location

@@ 786-797 (lines=12) @@
783
     *
784
     * @return Array of PlaygroundGame\Entity\Game
785
     */
786
    public function getPrizeCategoryGames($categoryid)
787
    {
788
        $em = $this->serviceLocator->get('doctrine.entitymanager.orm_default');
789
790
        $query = $em->createQuery('SELECT g FROM PlaygroundGame\Entity\Game g
791
            WHERE (g.prizeCategory = :categoryid AND g.broadcastPlatform = 1)
792
            ORDER BY g.publicationDate DESC');
793
        $query->setParameter('categoryid', $categoryid);
794
        $games = $query->getResult();
795
796
        return $games;
797
    }
798
799
    public function getGameIdentifierFromFacebook($fbPageId)
800
    {