Code Duplication    Length = 9-11 lines in 3 locations

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

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