Code Duplication    Length = 8-8 lines in 3 locations

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

@@ 400-407 (lines=8) @@
397
        Location $location,
398
        ContactInformation $contactInformation
399
    ) {
400
        if ($this->raLocations->containsWithId($raLocationId)) {
401
            throw new DomainException(sprintf(
402
                'Cannot add RaLocation with RaLocationId "%s" to RaLocations of InstitutionConfiguration "%s":'
403
                . ' it is already present',
404
                $raLocationId,
405
                $this->getAggregateRootId()
406
            ));
407
        }
408
409
        $this->apply(new RaLocationAddedEvent(
410
            $this->institutionConfigurationId,
@@ 431-438 (lines=8) @@
428
        Location $location,
429
        ContactInformation $contactInformation
430
    ) {
431
        if (!$this->raLocations->containsWithId($raLocationId)) {
432
            throw new DomainException(sprintf(
433
                'Cannot change RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
434
                . ' it is not present',
435
                $raLocationId,
436
                $this->getAggregateRootId()
437
            ));
438
        }
439
440
        $raLocation = $this->raLocations->getById($raLocationId);
441
@@ 468-475 (lines=8) @@
465
     */
466
    public function removeRaLocation(RaLocationId $raLocationId)
467
    {
468
        if (!$this->raLocations->containsWithId($raLocationId)) {
469
            throw new DomainException(sprintf(
470
                'Cannot remove RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
471
                . ' it is not present',
472
                $raLocationId,
473
                $this->getAggregateRootId()
474
            ));
475
        }
476
477
        $this->apply(new RaLocationRemovedEvent($this->institutionConfigurationId, $raLocationId));
478
    }