Code Duplication    Length = 3-11 lines in 2 locations

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

@@ 622-632 (lines=11) @@
619
                $contactInformation,
620
                $institution
621
            ));
622
        } elseif ($role->equals(new RegistrationAuthorityRole(RegistrationAuthorityRole::ROLE_RAA))) {
623
            $this->apply(new IdentityAccreditedAsRaaForInstitutionEvent(
624
                $this->id,
625
                $this->nameId,
626
                $this->institution,
627
                $role,
628
                $location,
629
                $contactInformation,
630
                $institution
631
            ));
632
        } else {
633
            throw new DomainException('An Identity can only be accredited with either the RA or RAA role');
634
        }
635
    }
@@ 687-689 (lines=3) @@
684
685
        if ($role->equals(new RegistrationAuthorityRole(RegistrationAuthorityRole::ROLE_RA))) {
686
            $this->apply(new AppointedAsRaForInstitutionEvent($this->id, $this->institution, $this->nameId, $institution));
687
        } elseif ($role->equals(new RegistrationAuthorityRole(RegistrationAuthorityRole::ROLE_RAA))) {
688
            $this->apply(new AppointedAsRaaForInstitutionEvent($this->id, $this->institution, $this->nameId, $institution));
689
        } else {
690
            throw new DomainException('An Identity can only be appointed as either RA or RAA');
691
        }
692
    }