Code Duplication    Length = 16-16 lines in 2 locations

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

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