Code Duplication    Length = 8-8 lines in 3 locations

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

@@ 377-384 (lines=8) @@
374
        Location $location,
375
        ContactInformation $contactInformation
376
    ) {
377
        if ($this->raLocations->containsWithId($raLocationId)) {
378
            throw new DomainException(sprintf(
379
                'Cannot add RaLocation with RaLocationId "%s" to RaLocations of InstitutionConfiguration "%s":'
380
                . ' it is already present',
381
                $raLocationId,
382
                $this->getAggregateRootId()
383
            ));
384
        }
385
386
        $this->apply(new RaLocationAddedEvent(
387
            $this->institutionConfigurationId,
@@ 408-415 (lines=8) @@
405
        Location $location,
406
        ContactInformation $contactInformation
407
    ) {
408
        if (!$this->raLocations->containsWithId($raLocationId)) {
409
            throw new DomainException(sprintf(
410
                'Cannot change RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
411
                . ' it is not present',
412
                $raLocationId,
413
                $this->getAggregateRootId()
414
            ));
415
        }
416
417
        $raLocation = $this->raLocations->getById($raLocationId);
418
@@ 445-452 (lines=8) @@
442
     */
443
    public function removeRaLocation(RaLocationId $raLocationId)
444
    {
445
        if (!$this->raLocations->containsWithId($raLocationId)) {
446
            throw new DomainException(sprintf(
447
                'Cannot remove RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
448
                . ' it is not present',
449
                $raLocationId,
450
                $this->getAggregateRootId()
451
            ));
452
        }
453
454
        $this->apply(new RaLocationRemovedEvent($this->institutionConfigurationId, $raLocationId));
455
    }