Code Duplication    Length = 8-8 lines in 3 locations

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

@@ 252-259 (lines=8) @@
249
        Location $location,
250
        ContactInformation $contactInformation
251
    ) {
252
        if ($this->raLocations->containsWithId($raLocationId)) {
253
            throw new DomainException(sprintf(
254
                'Cannot add RaLocation with RaLocationId "%s" to RaLocations of InstitutionConfiguration "%s":'
255
                . ' it is already present',
256
                $raLocationId,
257
                $this->getAggregateRootId()
258
            ));
259
        }
260
261
        $this->apply(new RaLocationAddedEvent(
262
            $this->institutionConfigurationId,
@@ 283-290 (lines=8) @@
280
        Location $location,
281
        ContactInformation $contactInformation
282
    ) {
283
        if (!$this->raLocations->containsWithId($raLocationId)) {
284
            throw new DomainException(sprintf(
285
                'Cannot change RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
286
                . ' it is not present',
287
                $raLocationId,
288
                $this->getAggregateRootId()
289
            ));
290
        }
291
292
        $raLocation = $this->raLocations->getById($raLocationId);
293
@@ 320-327 (lines=8) @@
317
     */
318
    public function removeRaLocation(RaLocationId $raLocationId)
319
    {
320
        if (!$this->raLocations->containsWithId($raLocationId)) {
321
            throw new DomainException(sprintf(
322
                'Cannot remove RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":'
323
                . ' it is not present',
324
                $raLocationId,
325
                $this->getAggregateRootId()
326
            ));
327
        }
328
329
        $this->apply(new RaLocationRemovedEvent($this->institutionConfigurationId, $raLocationId));
330
    }