Code Duplication    Length = 8-8 lines in 3 locations

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

@@ 325-332 (lines=8) @@
322
        Location $location,
323
        ContactInformation $contactInformation
324
    ) {
325
        if ($this->raLocations->containsWithId($raLocationId)) {
326
            throw new DomainException(sprintf(
327
                'Cannot add RaLocation with RaLocationId "%s" to RaLocations of InstitutionConfiguration "%s":'
328
                . ' it is already present',
329
                $raLocationId,
330
                $this->getAggregateRootId()
331
            ));
332
        }
333
334
        $this->apply(new RaLocationAddedEvent(
335
            $this->institutionConfigurationId,
@@ 356-363 (lines=8) @@
353
        Location $location,
354
        ContactInformation $contactInformation
355
    ) {
356
        if (!$this->raLocations->containsWithId($raLocationId)) {
357
            throw new DomainException(sprintf(
358
                'Cannot change RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
359
                . ' it is not present',
360
                $raLocationId,
361
                $this->getAggregateRootId()
362
            ));
363
        }
364
365
        $raLocation = $this->raLocations->getById($raLocationId);
366
@@ 393-400 (lines=8) @@
390
     */
391
    public function removeRaLocation(RaLocationId $raLocationId)
392
    {
393
        if (!$this->raLocations->containsWithId($raLocationId)) {
394
            throw new DomainException(sprintf(
395
                'Cannot remove RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
396
                . ' it is not present',
397
                $raLocationId,
398
                $this->getAggregateRootId()
399
            ));
400
        }
401
402
        $this->apply(new RaLocationRemovedEvent($this->institutionConfigurationId, $raLocationId));
403
    }