Code Duplication    Length = 20-20 lines in 2 locations

src/Service/PostVote.php 2 locations

@@ 586-605 (lines=20) @@
583
        return true;
584
    }
585
586
    public function addView($user, $ipAddress, $post)
587
    {
588
        $postvoteViewMapper = $this->getPostVoteViewMapper();
589
        $postView = new \PlaygroundGame\Entity\PostVoteView();
590
        $postView->setPost($post)
591
            ->setPostvote($post->getPostvote())
592
            ->setUser($user)
593
            ->setIp($ipAddress);
594
        $postvoteViewMapper->insert($postView);
595
596
        $this->getEventManager()->trigger(
597
            __FUNCTION__ . '.post',
598
            $this,
599
            array(
600
                'post' => $post
601
            )
602
        );
603
604
        return true;
605
    }
606
607
    public function addShare($post, $user)
608
    {
@@ 607-626 (lines=20) @@
604
        return true;
605
    }
606
607
    public function addShare($post, $user)
608
    {
609
        $postvoteShareMapper = $this->getPostVoteShareMapper();
610
        $postShare = new \PlaygroundGame\Entity\PostVoteShare();
611
        $postShare->setPost($post)
612
            ->setPostvote($post->getPostvote())
613
            ->setUser($user)
614
            ->setOrigin('mail');
615
        $postvoteShareMapper->insert($postShare);
616
617
        $this->getEventManager()->trigger(
618
            __FUNCTION__ . '.post',
619
            $this,
620
            array(
621
                'post' => $post
622
            )
623
        );
624
625
        return true;
626
    }
627
628
    /**
629
     * Get all comments for this game