Code Duplication    Length = 8-8 lines in 3 locations

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

@@ 203-210 (lines=8) @@
200
        Location $location,
201
        ContactInformation $contactInformation
202
    ) {
203
        if ($this->raLocations->containsWithId($raLocationId)) {
204
            throw new DomainException(sprintf(
205
                'Cannot add RaLocation with RaLocationId "%s" to RaLocations of InstitutionConfiguration "%s":'
206
                . ' it is already present',
207
                $raLocationId,
208
                $this->getAggregateRootId()
209
            ));
210
        }
211
212
        $this->apply(new RaLocationAddedEvent(
213
            $this->institutionConfigurationId,
@@ 234-241 (lines=8) @@
231
        Location $location,
232
        ContactInformation $contactInformation
233
    ) {
234
        if (!$this->raLocations->containsWithId($raLocationId)) {
235
            throw new DomainException(sprintf(
236
                'Cannot change RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
237
                . ' it is not present',
238
                $raLocationId,
239
                $this->getAggregateRootId()
240
            ));
241
        }
242
243
        $raLocation = $this->raLocations->getById($raLocationId);
244
@@ 271-278 (lines=8) @@
268
     */
269
    public function removeRaLocation(RaLocationId $raLocationId)
270
    {
271
        if (!$this->raLocations->containsWithId($raLocationId)) {
272
            throw new DomainException(sprintf(
273
                'Cannot remove RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
274
                . ' it is not present',
275
                $raLocationId,
276
                $this->getAggregateRootId()
277
            ));
278
        }
279
280
        $this->apply(new RaLocationRemovedEvent($this->institutionConfigurationId, $raLocationId));
281
    }