Code Duplication    Length = 20-20 lines in 2 locations

src/Service/PostVote.php 2 locations

@@ 666-685 (lines=20) @@
663
        return true;
664
    }
665
666
    public function addView($user, $ipAddress, $post)
667
    {
668
        $postvoteViewMapper = $this->getPostVoteViewMapper();
669
        $postView = new \PlaygroundGame\Entity\PostVoteView();
670
        $postView->setPost($post)
671
            ->setPostvote($post->getPostvote())
672
            ->setUser($user)
673
            ->setIp($ipAddress);
674
        $postvoteViewMapper->insert($postView);
675
676
        $this->getEventManager()->trigger(
677
            __FUNCTION__ . '.post',
678
            $this,
679
            array(
680
                'post' => $post
681
            )
682
        );
683
684
        return true;
685
    }
686
687
    public function addShare($post, $user)
688
    {
@@ 687-706 (lines=20) @@
684
        return true;
685
    }
686
687
    public function addShare($post, $user)
688
    {
689
        $postvoteShareMapper = $this->getPostVoteShareMapper();
690
        $postShare = new \PlaygroundGame\Entity\PostVoteShare();
691
        $postShare->setPost($post)
692
            ->setPostvote($post->getPostvote())
693
            ->setUser($user)
694
            ->setOrigin('mail');
695
        $postvoteShareMapper->insert($postShare);
696
697
        $this->getEventManager()->trigger(
698
            __FUNCTION__ . '.post',
699
            $this,
700
            array(
701
                'post' => $post
702
            )
703
        );
704
705
        return true;
706
    }
707
708
    /**
709
     * Get all comments for this game