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
    /**
392
     * Delete corrupted URL aliases (global, custom and system).

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

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