Code Duplication    Length = 8-8 lines in 3 locations

src/Surfnet/Stepup/Configuration/InstitutionConfiguration.php 3 locations

@@ 102-109 (lines=8) @@
99
        Location $location,
100
        ContactInformation $contactInformation
101
    ) {
102
        if (!$this->raLocations->containsWithId($raLocationId)) {
103
            throw new DomainException(sprintf(
104
                'Cannot change RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
105
                . 'it is not present',
106
                $raLocationId,
107
                $this->getAggregateRootId()
108
            ));
109
        }
110
111
        $raLocation = $this->raLocations->getById($raLocationId);
112
@@ 136-143 (lines=8) @@
133
134
    public function removeRaLocation(RaLocationId $raLocationId)
135
    {
136
        if (!$this->raLocations->containsWithId($raLocationId)) {
137
            throw new DomainException(sprintf(
138
                'Cannot remove RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
139
                . 'it is not present',
140
                $raLocationId,
141
                $this->getAggregateRootId()
142
            ));
143
        }
144
145
        $this->apply(new RaLocationRemovedEvent($this->institutionConfigurationId, $raLocationId));
146
    }
@@ 78-85 (lines=8) @@
75
        Location $location,
76
        ContactInformation $contactInformation
77
    ) {
78
        if ($this->raLocations->containsWithId($raLocationId)) {
79
            throw new DomainException(sprintf(
80
                'Cannot add RaLocation with RaLocationId "%s" to RaLocations of InstitutionConfiguration "%s":'
81
                . 'it is already present',
82
                $raLocationId,
83
                $this->getAggregateRootId()
84
            ));
85
        }
86
87
        $this->apply(new RaLocationAddedEvent(
88
            $this->institutionConfigurationId,