Code Duplication    Length = 14-16 lines in 2 locations

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

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

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

@@ 408-423 (lines=16) @@
405
     *
406
     * @return array
407
     */
408
    private function getCacheTags(ContentInfo $contentInfo, array $tags = [])
409
    {
410
        $tags[] = 'content-' . $contentInfo->id;
411
412
        if ($contentInfo->mainLocationId) {
413
            $locations = $this->persistenceHandler->locationHandler()->loadLocationsByContent($contentInfo->id);
414
            foreach ($locations as $location) {
415
                $tags[] = 'location-' . $location->id;
416
                foreach (explode('/', trim($location->pathString, '/')) as $pathId) {
417
                    $tags[] = 'location-path-' . $pathId;
418
                }
419
            }
420
        }
421
422
        return array_unique($tags);
423
    }
424
425
    private function getCacheTagsForVersion(VersionInfo $versionInfo, array $tags = [])
426
    {