Code Duplication    Length = 8-9 lines in 2 locations

eZ/Publish/Core/Persistence/Cache/ContentHandler.php 1 location

@@ 398-406 (lines=9) @@
395
            $tags[] = 'content-fields-type-' . $contentInfo->contentTypeId;
396
        }
397
398
        if ($contentInfo->mainLocationId) {
399
            $locations = $this->persistenceHandler->locationHandler()->loadLocationsByContent($contentInfo->id);
400
            foreach ($locations as $location) {
401
                $tags[] = 'location-' . $location->id;
402
                foreach (explode('/', trim($location->pathString, '/')) as $pathId) {
403
                    $tags[] = 'location-path-' . $pathId;
404
                }
405
            }
406
        }
407
408
        return array_unique($tags);
409
    }

eZ/Publish/Core/Persistence/Cache/UrlAliasHandler.php 1 location

@@ 378-385 (lines=8) @@
375
    {
376
        $tags[] = 'urlAlias-' . $urlAlias->id;
377
378
        if ($urlAlias->type === UrlAlias::LOCATION) {
379
            $cacheTags[] = 'urlAlias-location-' . $urlAlias->destination;
380
            $location = $this->persistenceHandler->locationHandler()->load($urlAlias->destination);
381
            foreach (explode('/', trim($location->pathString, '/')) as $pathId) {
382
                $tags[] = 'urlAlias-location-path-' . $pathId;
383
            }
384
        }
385
386
        return array_unique($tags);
387
    }
388
}