Code Duplication    Length = 3-6 lines in 4 locations

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

@@ 44-49 (lines=6) @@
41
42
            if ($info->mainLocationId) {
43
                $locations = $this->persistenceHandler->locationHandler()->loadLocationsByContent($info->id);
44
                foreach ($locations as $location) {
45
                    $tags[] = 'location-' . $location->id;
46
                    foreach (explode('/', trim($location->pathString, '/')) as $pathId) {
47
                        $tags[] = 'location-path-' . $pathId;
48
                    }
49
                }
50
            }
51
52
            return $tags;

eZ/Publish/Core/Persistence/Cache/LocationHandler.php 2 locations

@@ 37-40 (lines=4) @@
34
                 'location-' . $location->id,
35
                 'location-data-' . $location->id
36
             ];
37
             foreach (\explode('/', \trim($location->pathString, '/')) as $pathId) {
38
                 $tags[] = 'location-path-' . $pathId;
39
                 $tags[] = 'location-path-data-' . $pathId;
40
             }
41
42
             return $tags;
43
         };
@@ 414-417 (lines=4) @@
411
        $tags[] = 'content-' . $location->contentId;
412
        $tags[] = 'location-' . $location->id;
413
        $tags[] = 'location-data-' . $location->id;
414
        foreach (explode('/', trim($location->pathString, '/')) as $pathId) {
415
            $tags[] = 'location-path-' . $pathId;
416
            $tags[] = 'location-path-data-' . $pathId;
417
        }
418
419
        return $tags;
420
    }

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

@@ 381-383 (lines=3) @@
378
                // To make sure tree operations affecting this can clear the permission cache
379
                $locations = $innerHandler->locationHandler()->loadLocationsByContent($groupId);
380
                foreach ($locations as $location) {
381
                    foreach (explode('/', trim($location->pathString, '/')) as $pathId) {
382
                        $cacheTags[] = 'location-path-' . $pathId;
383
                    }
384
                }
385
386
                return $cacheTags;