Code Duplication    Length = 6-9 lines in 2 locations

src/CacheManager.php 1 location

@@ 77-85 (lines=9) @@
74
    {
75
        @trigger_error('The '.__METHOD__.' method is deprecated since version 1.2 and will be removed in 2.0. Use the TagHandler instead.', E_USER_DEPRECATED);
76
77
        if (!$replace && $response->headers->has($this->getTagsHeader())) {
78
            $header = $response->headers->get($this->getTagsHeader());
79
            if ('' !== $header) {
80
                $tags = array_merge(
81
                    explode(',', $response->headers->get($this->getTagsHeader())),
82
                    $tags
83
                );
84
            }
85
        }
86
87
        $uniqueTags = array_unique($tags);
88
        $response->headers->set($this->getTagsHeader(), implode(',', $uniqueTags));

src/Http/SymfonyResponseTagger.php 1 location

@@ 35-40 (lines=6) @@
32
            return $this;
33
        }
34
35
        if (!$replace && $response->headers->has($this->getTagsHeaderName())) {
36
            $header = $response->headers->get($this->getTagsHeaderName());
37
            if ('' !== $header) {
38
                $this->addTags(explode(',', $response->headers->get($this->getTagsHeaderName())));
39
            }
40
        }
41
42
        $response->headers->set($this->getTagsHeaderName(), $this->getTagsHeaderValue());
43