Code Duplication    Length = 9-11 lines in 3 locations

eZ/Publish/Core/Repository/LocationService.php 3 locations

@@ 424-434 (lines=11) @@
421
            $newLocation = $this->persistenceHandler->locationHandler()->create($spiLocationCreateStruct);
422
423
            $urlAliasNames = $this->nameSchemaService->resolveUrlAliasSchema($content);
424
            foreach ($urlAliasNames as $languageCode => $name) {
425
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
426
                    $newLocation->id,
427
                    $newLocation->parentId,
428
                    $name,
429
                    $languageCode,
430
                    $content->contentInfo->alwaysAvailable,
431
                    // @todo: this is legacy storage specific for updating ezcontentobject_tree.path_identification_string, to be removed
432
                    $languageCode === $content->contentInfo->mainLanguageCode
433
                );
434
            }
435
436
            $this->repository->commit();
437
        } catch (Exception $e) {
@@ 163-171 (lines=9) @@
160
161
            $content = $this->repository->getContentService()->loadContent($newLocation->contentId);
162
            $urlAliasNames = $this->nameSchemaService->resolveUrlAliasSchema($content);
163
            foreach ($urlAliasNames as $languageCode => $name) {
164
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
165
                    $newLocation->id,
166
                    $loadedTargetLocation->id,
167
                    $name,
168
                    $languageCode,
169
                    $content->contentInfo->alwaysAvailable
170
                );
171
            }
172
173
            $this->persistenceHandler->urlAliasHandler()->locationCopied(
174
                $loadedSubtree->id,
@@ 662-670 (lines=9) @@
659
660
            $content = $this->repository->getContentService()->loadContent($location->contentId);
661
            $urlAliasNames = $this->nameSchemaService->resolveUrlAliasSchema($content);
662
            foreach ($urlAliasNames as $languageCode => $name) {
663
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
664
                    $location->id,
665
                    $newParentLocation->id,
666
                    $name,
667
                    $languageCode,
668
                    $content->contentInfo->alwaysAvailable
669
                );
670
            }
671
672
            $this->persistenceHandler->urlAliasHandler()->locationMoved(
673
                $location->id,