Code Duplication    Length = 6-6 lines in 2 locations

src/Service/Keeper.php 2 locations

@@ 122-127 (lines=6) @@
119
            $response = new Response();
120
        }
121
122
        if ($lifetime > 0) {
123
            $response
124
                ->setMaxAge($lifetime)
125
                ->setSharedMaxAge($lifetime)
126
                ->setExpires((new \DateTime())->modify('+'.$lifetime.' seconds'));
127
        }
128
129
        return $response->setLastModified($this->getMax($params));
130
    }
@@ 154-159 (lines=6) @@
151
            $response = new Response();
152
        }
153
154
        if ($lifetime > 0) {
155
            $response
156
                ->setMaxAge($lifetime)
157
                ->setSharedMaxAge($lifetime)
158
                ->setExpires((new \DateTime())->modify('+'.$lifetime.' seconds'));
159
        }
160
161
        $response->setLastModified($this->getMax($params));
162