Code Duplication    Length = 8-8 lines in 2 locations

EventListener/CacheControlSubscriber.php 2 locations

@@ 202-209 (lines=8) @@
199
        $flags = array('must_revalidate', 'proxy_revalidate', 'no_transform', 'no_cache');
200
        $options = array('stale_if_error', 'stale_while_revalidate');
201
202
        foreach ($flags as $key) {
203
            $flag = str_replace('_', '-', $key);
204
            if (!empty($controls[$key])
205
                && ($overwrite || !$response->headers->hasCacheControlDirective($flag))
206
            ) {
207
                $response->headers->addCacheControlDirective($flag);
208
            }
209
        }
210
211
        foreach ($options as $key) {
212
            $option = str_replace('_', '-', $key);
@@ 211-218 (lines=8) @@
208
            }
209
        }
210
211
        foreach ($options as $key) {
212
            $option = str_replace('_', '-', $key);
213
            if (isset($controls[$key])
214
                && ($overwrite || !$response->headers->hasCacheControlDirective($option))
215
            ) {
216
                $response->headers->addCacheControlDirective($option, $controls[$key]);
217
            }
218
        }
219
    }
220
221
    /**