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

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