Code Duplication    Length = 3-11 lines in 2 locations

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

@@ 641-651 (lines=11) @@
638
                $contactInformation,
639
                $institution
640
            ));
641
        } elseif ($role->equals(new RegistrationAuthorityRole(RegistrationAuthorityRole::ROLE_RAA))) {
642
            $this->apply(new IdentityAccreditedAsRaaForInstitutionEvent(
643
                $this->id,
644
                $this->nameId,
645
                $this->institution,
646
                $role,
647
                $location,
648
                $contactInformation,
649
                $institution
650
            ));
651
        } else {
652
            throw new DomainException('An Identity can only be accredited with either the RA or RAA role');
653
        }
654
    }
@@ 706-708 (lines=3) @@
703
704
        if ($role->equals(new RegistrationAuthorityRole(RegistrationAuthorityRole::ROLE_RA))) {
705
            $this->apply(new AppointedAsRaForInstitutionEvent($this->id, $this->institution, $this->nameId, $institution));
706
        } elseif ($role->equals(new RegistrationAuthorityRole(RegistrationAuthorityRole::ROLE_RAA))) {
707
            $this->apply(new AppointedAsRaaForInstitutionEvent($this->id, $this->institution, $this->nameId, $institution));
708
        } else {
709
            throw new DomainException('An Identity can only be appointed as either RA or RAA');
710
        }
711
    }