Code Duplication    Length = 16-16 lines in 2 locations

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Projector/RaSecondFactorProjector.php 2 locations

@@ 75-90 (lines=16) @@
72
        $this->identityRepository = $identityRepository;
73
    }
74
75
    public function applyIdentityRenamedEvent(IdentityRenamedEvent $event)
76
    {
77
        $secondFactors = $this->raSecondFactorRepository->findByIdentityId((string) $event->identityId);
78
79
        if (count($secondFactors) === 0) {
80
            return;
81
        }
82
83
        $commonName = $event->commonName;
84
85
        foreach ($secondFactors as $secondFactor) {
86
            $secondFactor->name = $commonName;
87
        }
88
89
        $this->raSecondFactorRepository->saveAll($secondFactors);
90
    }
91
92
    public function applyIdentityEmailChangedEvent(IdentityEmailChangedEvent $event)
93
    {
@@ 92-107 (lines=16) @@
89
        $this->raSecondFactorRepository->saveAll($secondFactors);
90
    }
91
92
    public function applyIdentityEmailChangedEvent(IdentityEmailChangedEvent $event)
93
    {
94
        $secondFactors = $this->raSecondFactorRepository->findByIdentityId((string) $event->identityId);
95
96
        if (count($secondFactors) === 0) {
97
            return;
98
        }
99
100
        $email = $event->email;
101
102
        foreach ($secondFactors as $secondFactor) {
103
            $secondFactor->email = $email;
104
        }
105
106
        $this->raSecondFactorRepository->saveAll($secondFactors);
107
    }
108
109
    public function applyYubikeySecondFactorBootstrappedEvent(YubikeySecondFactorBootstrappedEvent $event)
110
    {