Code Duplication    Length = 13-13 lines in 4 locations

src/Surfnet/Stepup/Identity/Identity.php 4 locations

@@ 634-646 (lines=13) @@
631
        $this->vettedSecondFactors->set((string) $secondFactor->getId(), $secondFactor);
632
    }
633
634
    protected function applyYubikeyPossessionProvenEvent(YubikeyPossessionProvenEvent $event)
635
    {
636
        $secondFactor = UnverifiedSecondFactor::create(
637
            $event->secondFactorId,
638
            $this,
639
            new SecondFactorType('yubikey'),
640
            $event->yubikeyPublicId,
641
            $event->emailVerificationWindow,
642
            $event->emailVerificationNonce
643
        );
644
645
        $this->unverifiedSecondFactors->set((string) $secondFactor->getId(), $secondFactor);
646
    }
647
648
    protected function applyPhonePossessionProvenEvent(PhonePossessionProvenEvent $event)
649
    {
@@ 648-660 (lines=13) @@
645
        $this->unverifiedSecondFactors->set((string) $secondFactor->getId(), $secondFactor);
646
    }
647
648
    protected function applyPhonePossessionProvenEvent(PhonePossessionProvenEvent $event)
649
    {
650
        $secondFactor = UnverifiedSecondFactor::create(
651
            $event->secondFactorId,
652
            $this,
653
            new SecondFactorType('sms'),
654
            $event->phoneNumber,
655
            $event->emailVerificationWindow,
656
            $event->emailVerificationNonce
657
        );
658
659
        $this->unverifiedSecondFactors->set((string) $secondFactor->getId(), $secondFactor);
660
    }
661
662
    protected function applyGssfPossessionProvenEvent(GssfPossessionProvenEvent $event)
663
    {
@@ 662-674 (lines=13) @@
659
        $this->unverifiedSecondFactors->set((string) $secondFactor->getId(), $secondFactor);
660
    }
661
662
    protected function applyGssfPossessionProvenEvent(GssfPossessionProvenEvent $event)
663
    {
664
        $secondFactor = UnverifiedSecondFactor::create(
665
            $event->secondFactorId,
666
            $this,
667
            new SecondFactorType((string) $event->stepupProvider),
668
            $event->gssfId,
669
            $event->emailVerificationWindow,
670
            $event->emailVerificationNonce
671
        );
672
673
        $this->unverifiedSecondFactors->set((string) $secondFactor->getId(), $secondFactor);
674
    }
675
676
    protected function applyU2fDevicePossessionProvenEvent(U2fDevicePossessionProvenEvent $event)
677
    {
@@ 676-688 (lines=13) @@
673
        $this->unverifiedSecondFactors->set((string) $secondFactor->getId(), $secondFactor);
674
    }
675
676
    protected function applyU2fDevicePossessionProvenEvent(U2fDevicePossessionProvenEvent $event)
677
    {
678
        $secondFactor = UnverifiedSecondFactor::create(
679
            $event->secondFactorId,
680
            $this,
681
            new SecondFactorType('u2f'),
682
            $event->keyHandle,
683
            $event->emailVerificationWindow,
684
            $event->emailVerificationNonce
685
        );
686
687
        $this->unverifiedSecondFactors->set((string) $secondFactor->getId(), $secondFactor);
688
    }
689
690
    protected function applyEmailVerifiedEvent(EmailVerifiedEvent $event)
691
    {