Code Duplication    Length = 9-11 lines in 3 locations

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

@@ 161-169 (lines=9) @@
158
159
            $content = $this->repository->getContentService()->loadContent($newLocation->contentId);
160
            $urlAliasNames = $this->nameSchemaService->resolveUrlAliasSchema($content);
161
            foreach ($urlAliasNames as $languageCode => $name) {
162
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
163
                    $newLocation->id,
164
                    $loadedTargetLocation->id,
165
                    $name,
166
                    $languageCode,
167
                    $content->contentInfo->alwaysAvailable
168
                );
169
            }
170
171
            $this->persistenceHandler->urlAliasHandler()->locationCopied(
172
                $loadedSubtree->id,
@@ 399-409 (lines=11) @@
396
            $newLocation = $this->persistenceHandler->locationHandler()->create($spiLocationCreateStruct);
397
398
            $urlAliasNames = $this->nameSchemaService->resolveUrlAliasSchema($content);
399
            foreach ($urlAliasNames as $languageCode => $name) {
400
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
401
                    $newLocation->id,
402
                    $newLocation->parentId,
403
                    $name,
404
                    $languageCode,
405
                    $content->contentInfo->alwaysAvailable,
406
                    // @todo: this is legacy storage specific for updating ezcontentobject_tree.path_identification_string, to be removed
407
                    $languageCode === $content->contentInfo->mainLanguageCode
408
                );
409
            }
410
411
            $this->repository->commit();
412
        } catch (Exception $e) {
@@ 637-645 (lines=9) @@
634
635
            $content = $this->repository->getContentService()->loadContent($location->contentId);
636
            $urlAliasNames = $this->nameSchemaService->resolveUrlAliasSchema($content);
637
            foreach ($urlAliasNames as $languageCode => $name) {
638
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
639
                    $location->id,
640
                    $newParentLocation->id,
641
                    $name,
642
                    $languageCode,
643
                    $content->contentInfo->alwaysAvailable
644
                );
645
            }
646
647
            $this->persistenceHandler->urlAliasHandler()->locationMoved(
648
                $location->id,