Code Duplication    Length = 3-11 lines in 2 locations

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

@@ 636-646 (lines=11) @@
633
                $contactInformation,
634
                $institution
635
            ));
636
        } elseif ($role->equals(new RegistrationAuthorityRole(RegistrationAuthorityRole::ROLE_RAA))) {
637
            $this->apply(new IdentityAccreditedAsRaaForInstitutionEvent(
638
                $this->id,
639
                $this->nameId,
640
                $this->institution,
641
                $role,
642
                $location,
643
                $contactInformation,
644
                $institution
645
            ));
646
        } else {
647
            throw new DomainException('An Identity can only be accredited with either the RA or RAA role');
648
        }
649
    }
@@ 701-703 (lines=3) @@
698
699
        if ($role->equals(new RegistrationAuthorityRole(RegistrationAuthorityRole::ROLE_RA))) {
700
            $this->apply(new AppointedAsRaForInstitutionEvent($this->id, $this->institution, $this->nameId, $institution));
701
        } elseif ($role->equals(new RegistrationAuthorityRole(RegistrationAuthorityRole::ROLE_RAA))) {
702
            $this->apply(new AppointedAsRaaForInstitutionEvent($this->id, $this->institution, $this->nameId, $institution));
703
        } else {
704
            throw new DomainException('An Identity can only be appointed as either RA or RAA');
705
        }
706
    }