Code Duplication    Length = 9-11 lines in 4 locations

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

@@ 175-183 (lines=9) @@
172
173
            $content = $this->repository->getContentService()->loadContent($newLocation->contentId);
174
            $urlAliasNames = $this->nameSchemaService->resolveUrlAliasSchema($content);
175
            foreach ($urlAliasNames as $languageCode => $name) {
176
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
177
                    $newLocation->id,
178
                    $loadedTargetLocation->id,
179
                    $name,
180
                    $languageCode,
181
                    $content->contentInfo->alwaysAvailable
182
                );
183
            }
184
185
            $this->persistenceHandler->urlAliasHandler()->locationCopied(
186
                $loadedSubtree->id,
@@ 439-449 (lines=11) @@
436
            $newLocation = $this->persistenceHandler->locationHandler()->create($spiLocationCreateStruct);
437
438
            $urlAliasNames = $this->nameSchemaService->resolveUrlAliasSchema($content);
439
            foreach ($urlAliasNames as $languageCode => $name) {
440
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
441
                    $newLocation->id,
442
                    $newLocation->parentId,
443
                    $name,
444
                    $languageCode,
445
                    $content->contentInfo->alwaysAvailable,
446
                    // @todo: this is legacy storage specific for updating ezcontentobject_tree.path_identification_string, to be removed
447
                    $languageCode === $content->contentInfo->mainLanguageCode
448
                );
449
            }
450
451
            $this->repository->commit();
452
        } catch (Exception $e) {
@@ 677-685 (lines=9) @@
674
675
            $content = $this->repository->getContentService()->loadContent($location->contentId);
676
            $urlAliasNames = $this->nameSchemaService->resolveUrlAliasSchema($content);
677
            foreach ($urlAliasNames as $languageCode => $name) {
678
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
679
                    $location->id,
680
                    $newParentLocation->id,
681
                    $name,
682
                    $languageCode,
683
                    $content->contentInfo->alwaysAvailable
684
                );
685
            }
686
687
            $this->persistenceHandler->urlAliasHandler()->locationMoved(
688
                $location->id,

eZ/Publish/Core/Repository/ContentService.php 1 location

@@ 999-1008 (lines=10) @@
996
            $content->getVersionInfo()->getContentInfo()
997
        );
998
        foreach ($locations as $location) {
999
            foreach ($urlAliasNames as $languageCode => $name) {
1000
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
1001
                    $location->id,
1002
                    $location->parentLocationId,
1003
                    $name,
1004
                    $languageCode,
1005
                    $content->contentInfo->alwaysAvailable,
1006
                    $updatePathIdentificationString ? $languageCode === $content->contentInfo->mainLanguageCode : false
1007
                );
1008
            }
1009
            // archive URL aliases of Translations that got deleted
1010
            $this->persistenceHandler->urlAliasHandler()->archiveUrlAliasesForDeletedTranslations(
1011
                $location->id,