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,
@@ 408-418 (lines=11) @@
405
            $newLocation = $this->persistenceHandler->locationHandler()->create($spiLocationCreateStruct);
406
407
            $urlAliasNames = $this->nameSchemaService->resolveUrlAliasSchema($content);
408
            foreach ($urlAliasNames as $languageCode => $name) {
409
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
410
                    $newLocation->id,
411
                    $newLocation->parentId,
412
                    $name,
413
                    $languageCode,
414
                    $content->contentInfo->alwaysAvailable,
415
                    // @todo: this is legacy storage specific for updating ezcontentobject_tree.path_identification_string, to be removed
416
                    $languageCode === $content->contentInfo->mainLanguageCode
417
                );
418
            }
419
420
            $this->repository->commit();
421
        } catch (Exception $e) {
@@ 646-654 (lines=9) @@
643
644
            $content = $this->repository->getContentService()->loadContent($location->contentId);
645
            $urlAliasNames = $this->nameSchemaService->resolveUrlAliasSchema($content);
646
            foreach ($urlAliasNames as $languageCode => $name) {
647
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
648
                    $location->id,
649
                    $newParentLocation->id,
650
                    $name,
651
                    $languageCode,
652
                    $content->contentInfo->alwaysAvailable
653
                );
654
            }
655
656
            $this->persistenceHandler->urlAliasHandler()->locationMoved(
657
                $location->id,

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

@@ 1014-1023 (lines=10) @@
1011
            $content->getVersionInfo()->getContentInfo()
1012
        );
1013
        foreach ($locations as $location) {
1014
            foreach ($urlAliasNames as $languageCode => $name) {
1015
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
1016
                    $location->id,
1017
                    $location->parentLocationId,
1018
                    $name,
1019
                    $languageCode,
1020
                    $content->contentInfo->alwaysAvailable,
1021
                    $updatePathIdentificationString ? $languageCode === $content->contentInfo->mainLanguageCode : false
1022
                );
1023
            }
1024
        }
1025
    }
1026