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

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