Code Duplication    Length = 14-14 lines in 2 locations

Services/PaywallService.php 2 locations

@@ 491-504 (lines=14) @@
488
     *
489
     * @return UserSubscription
490
     */
491
    public function activateById($id)
492
    {
493
        $subscription = $this->em->getRepository('Newscoop\PaywallBundle\Entity\UserSubscription')
494
            ->findOneBy(array(
495
                'id' => $id,
496
        ));
497
498
        if ($subscription) {
499
            $this->activateUserSubscription($subscription);
500
            $this->em->flush();
501
        }
502
503
        return $subscription;
504
    }
505
506
    /**
507
     * Activates user subscription.
@@ 822-835 (lines=14) @@
819
     *
820
     * @return UserSubscription
821
     */
822
    public function deleteById($id)
823
    {
824
        $subscription = $this->em->getRepository('Newscoop\PaywallBundle\Entity\UserSubscription')
825
            ->findOneBy(array(
826
                'id' => $id,
827
            ));
828
829
        if ($subscription) {
830
            $this->em->remove($subscription);
831
            $this->em->flush();
832
        }
833
834
        return $subscription;
835
    }
836
837
    public function getOneById($id)
838
    {