Code Duplication    Length = 16-16 lines in 2 locations

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

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