Code Duplication    Length = 16-16 lines in 2 locations

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

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