Code Duplication    Length = 13-13 lines in 4 locations

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

@@ 761-773 (lines=13) @@
758
        $this->vettedSecondFactors->set((string)$secondFactor->getId(), $secondFactor);
759
    }
760
761
    protected function applyYubikeyPossessionProvenEvent(YubikeyPossessionProvenEvent $event)
762
    {
763
        $secondFactor = UnverifiedSecondFactor::create(
764
            $event->secondFactorId,
765
            $this,
766
            new SecondFactorType('yubikey'),
767
            $event->yubikeyPublicId,
768
            $event->emailVerificationWindow,
769
            $event->emailVerificationNonce
770
        );
771
772
        $this->unverifiedSecondFactors->set((string)$secondFactor->getId(), $secondFactor);
773
    }
774
775
    protected function applyYubikeyPossessionProvenAndVerifiedEvent(YubikeyPossessionProvenAndVerifiedEvent $event)
776
    {
@@ 789-801 (lines=13) @@
786
        $this->verifiedSecondFactors->set((string)$secondFactor->getId(), $secondFactor);
787
    }
788
789
    protected function applyPhonePossessionProvenEvent(PhonePossessionProvenEvent $event)
790
    {
791
        $secondFactor = UnverifiedSecondFactor::create(
792
            $event->secondFactorId,
793
            $this,
794
            new SecondFactorType('sms'),
795
            $event->phoneNumber,
796
            $event->emailVerificationWindow,
797
            $event->emailVerificationNonce
798
        );
799
800
        $this->unverifiedSecondFactors->set((string)$secondFactor->getId(), $secondFactor);
801
    }
802
803
    protected function applyPhonePossessionProvenAndVerifiedEvent(PhonePossessionProvenAndVerifiedEvent $event)
804
    {
@@ 817-829 (lines=13) @@
814
        $this->verifiedSecondFactors->set((string)$secondFactor->getId(), $secondFactor);
815
    }
816
817
    protected function applyGssfPossessionProvenEvent(GssfPossessionProvenEvent $event)
818
    {
819
        $secondFactor = UnverifiedSecondFactor::create(
820
            $event->secondFactorId,
821
            $this,
822
            new SecondFactorType((string)$event->stepupProvider),
823
            $event->gssfId,
824
            $event->emailVerificationWindow,
825
            $event->emailVerificationNonce
826
        );
827
828
        $this->unverifiedSecondFactors->set((string)$secondFactor->getId(), $secondFactor);
829
    }
830
831
    protected function applyGssfPossessionProvenAndVerifiedEvent(GssfPossessionProvenAndVerifiedEvent $event)
832
    {
@@ 845-857 (lines=13) @@
842
        $this->verifiedSecondFactors->set((string)$secondFactor->getId(), $secondFactor);
843
    }
844
845
    protected function applyU2fDevicePossessionProvenEvent(U2fDevicePossessionProvenEvent $event)
846
    {
847
        $secondFactor = UnverifiedSecondFactor::create(
848
            $event->secondFactorId,
849
            $this,
850
            new SecondFactorType('u2f'),
851
            $event->keyHandle,
852
            $event->emailVerificationWindow,
853
            $event->emailVerificationNonce
854
        );
855
856
        $this->unverifiedSecondFactors->set((string)$secondFactor->getId(), $secondFactor);
857
    }
858
859
    protected function applyU2fDevicePossessionProvenAndVerifiedEvent(U2fDevicePossessionProvenAndVerifiedEvent $event)
860
    {