Code Duplication    Length = 8-8 lines in 3 locations

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

@@ 73-80 (lines=8) @@
70
        Location $location,
71
        ContactInformation $contactInformation
72
    ) {
73
        if ($this->raLocations->containsWithId($raLocationId)) {
74
            throw new DomainException(sprintf(
75
                'Cannot add RaLocation with RaLocationId "%s" to RaLocations of InstitutionConfiguration "%s":'
76
                . 'it is already present',
77
                $raLocationId,
78
                $this->getAggregateRootId()
79
            ));
80
        }
81
82
        $this->apply(new RaLocationAddedEvent(
83
            $this->institutionConfigurationId,
@@ 97-104 (lines=8) @@
94
        Location $location,
95
        ContactInformation $contactInformation
96
    ) {
97
        if (!$this->raLocations->containsWithId($raLocationId)) {
98
            throw new DomainException(sprintf(
99
                'Cannot change RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
100
                . 'it is not present',
101
                $raLocationId,
102
                $this->getAggregateRootId()
103
            ));
104
        }
105
106
        $raLocation = $this->raLocations->getById($raLocationId);
107
@@ 131-138 (lines=8) @@
128
129
    public function removeRaLocation(RaLocationId $raLocationId)
130
    {
131
        if (!$this->raLocations->containsWithId($raLocationId)) {
132
            throw new DomainException(sprintf(
133
                'Cannot remove RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
134
                . 'it is not present',
135
                $raLocationId,
136
                $this->getAggregateRootId()
137
            ));
138
        }
139
140
        $this->apply(new RaLocationRemovedEvent($this->institutionConfigurationId, $raLocationId));
141
    }