Code Duplication    Length = 5-7 lines in 2 locations

eZ/Publish/Core/MVC/Symfony/Cache/Http/LocationAwareStore.php 1 location

@@ 154-158 (lines=5) @@
151
        // Usage of X-Group-Location-Id is deprecated.
152
        if ($request->headers->has('X-Group-Location-Id')) {
153
            $aLocationId = explode('; ', $request->headers->get('X-Group-Location-Id'));
154
        } elseif ($locationId[0] === '(' && substr($locationId, -1) === ')') {
155
            // Equivalent to X-Group-Location-Id, using a simple Regexp:
156
            // (123|456|789) => Purge for #123, #456 and #789 location IDs.
157
            $aLocationId = explode('|', substr($locationId, 1, -1));
158
        } else {
159
            $aLocationId = array($locationId);
160
        }
161

eZ/Publish/Core/MVC/Symfony/Cache/Http/Proxy/TagAwareStore.php 1 location

@@ 115-121 (lines=7) @@
112
113
        if ($request->headers->has('xkey')) {
114
            $tags = explode(' ', $request->headers->get('xkey'));
115
        } elseif ($locationId[0] === '(' && substr($locationId, -1) === ')') {
116
            // Deprecated: (123|456|789) => Purge for #123, #456 and #789 location IDs.
117
            $tags = array_map(
118
                function ($id) {return 'location-' . $id;},
119
                explode('|', substr($locationId, 1, -1))
120
            );
121
        } else {
122
            $tags = array('location-' . $locationId);
123
        }
124