Code Duplication    Length = 3-11 lines in 2 locations

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

@@ 613-623 (lines=11) @@
610
                $contactInformation,
611
                $institution
612
            ));
613
        } elseif ($role->equals(new RegistrationAuthorityRole(RegistrationAuthorityRole::ROLE_RAA))) {
614
            $this->apply(new IdentityAccreditedAsRaaForInstitutionEvent(
615
                $this->id,
616
                $this->nameId,
617
                $this->institution,
618
                $role,
619
                $location,
620
                $contactInformation,
621
                $institution
622
            ));
623
        } else {
624
            throw new DomainException('An Identity can only be accredited with either the RA or RAA role');
625
        }
626
    }
@@ 674-676 (lines=3) @@
671
672
        if ($role->equals(new RegistrationAuthorityRole(RegistrationAuthorityRole::ROLE_RA))) {
673
            $this->apply(new AppointedInstitutionAsRaEvent($this->id, $this->institution, $this->nameId, $institution));
674
        } elseif ($role->equals(new RegistrationAuthorityRole(RegistrationAuthorityRole::ROLE_RAA))) {
675
            $this->apply(new AppointedInstitutionAsRaaEvent($this->id, $this->institution, $this->nameId, $institution));
676
        } else {
677
            throw new DomainException('An Identity can only be appointed as either RA or RAA');
678
        }
679
    }