Code Duplication    Length = 8-8 lines in 2 locations

EventListener/CacheControlListener.php 2 locations

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