Code Duplication    Length = 6-9 lines in 2 locations

CacheManager.php 1 location

@@ 75-83 (lines=9) @@
72
     */
73
    public function tagResponse(Response $response, array $tags, $replace = false)
74
    {
75
        if (!$replace && $response->headers->has($this->getTagsHeader())) {
76
            $header = $response->headers->get($this->getTagsHeader());
77
            if ('' !== $header) {
78
                $tags = array_merge(
79
                    explode(',', $response->headers->get($this->getTagsHeader())),
80
                    $tags
81
                );
82
            }
83
        }
84
85
        $uniqueTags = array_unique($tags);
86
        $response->headers->set($this->getTagsHeader(), implode(',', $uniqueTags));

Handler/TagHandler.php 1 location

@@ 22-27 (lines=6) @@
19
     */
20
    public function tagResponse(Response $response, $replace = false)
21
    {
22
        if (!$replace && $response->headers->has($this->getTagsHeaderName())) {
23
            $header = $response->headers->get($this->getTagsHeaderName());
24
            if ('' !== $header) {
25
                $this->addTags(explode(',', $response->headers->get($this->getTagsHeaderName())));
26
            }
27
        }
28
29
        if ($this->hasTags()) {
30
            $response->headers->set($this->getTagsHeaderName(), $this->getTagsHeaderValue());