Code Duplication    Length = 9-11 lines in 4 locations

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

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

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

@@ 173-181 (lines=9) @@
170
171
            $content = $this->repository->getContentService()->loadContent($newLocation->contentId);
172
            $urlAliasNames = $this->nameSchemaService->resolveUrlAliasSchema($content);
173
            foreach ($urlAliasNames as $languageCode => $name) {
174
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
175
                    $newLocation->id,
176
                    $loadedTargetLocation->id,
177
                    $name,
178
                    $languageCode,
179
                    $content->contentInfo->alwaysAvailable
180
                );
181
            }
182
183
            $this->persistenceHandler->urlAliasHandler()->locationCopied(
184
                $loadedSubtree->id,
@@ 406-416 (lines=11) @@
403
            $newLocation = $this->persistenceHandler->locationHandler()->create($spiLocationCreateStruct);
404
405
            $urlAliasNames = $this->nameSchemaService->resolveUrlAliasSchema($content);
406
            foreach ($urlAliasNames as $languageCode => $name) {
407
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
408
                    $newLocation->id,
409
                    $newLocation->parentId,
410
                    $name,
411
                    $languageCode,
412
                    $content->contentInfo->alwaysAvailable,
413
                    // @todo: this is legacy storage specific for updating ezcontentobject_tree.path_identification_string, to be removed
414
                    $languageCode === $content->contentInfo->mainLanguageCode
415
                );
416
            }
417
418
            $this->repository->commit();
419
        } catch (Exception $e) {
@@ 644-652 (lines=9) @@
641
642
            $content = $this->repository->getContentService()->loadContent($location->contentId);
643
            $urlAliasNames = $this->nameSchemaService->resolveUrlAliasSchema($content);
644
            foreach ($urlAliasNames as $languageCode => $name) {
645
                $this->persistenceHandler->urlAliasHandler()->publishUrlAliasForLocation(
646
                    $location->id,
647
                    $newParentLocation->id,
648
                    $name,
649
                    $languageCode,
650
                    $content->contentInfo->alwaysAvailable
651
                );
652
            }
653
654
            $this->persistenceHandler->urlAliasHandler()->locationMoved(
655
                $location->id,