Code Duplication    Length = 8-8 lines in 2 locations

src/PredisCache.php 1 location

@@ 34-41 (lines=8) @@
31
     */
32
    public function set(Request $request, Response $response, $expires = null)
33
    {
34
        if ($expires === null) {
35
            $expiresHeader = null;
36
            if (!Arrays::tryGet($response->getResponseHeaders(), 'Expires', $expiresHeader)) {
37
                return;
38
            }
39
40
            $expires = Util::ensureNot(false, strtotime($expiresHeader[0]), "Unable to parse Expires value of '{$expiresHeader[0]}'");
41
        }
42
43
        $key = self::_getKey($request);
44
        $this->_client->set(

src/MongoCache.php 1 location

@@ 41-48 (lines=8) @@
38
    {
39
        Util::throwIfNotType(['int' => [$expires]], false, true);
40
41
        if ($expires === null) {
42
            $expiresHeader = null;
43
            if (!Arrays::tryGet($response->getResponseHeaders(), 'Expires', $expiresHeader)) {
44
                return;
45
            }
46
47
            $expires = Util::ensureNot(false, strtotime($expiresHeader[0]), "Unable to parse Expires value of '{$expiresHeader[0]}'");
48
        }
49
50
        $id = self::_getUniqueId($request);
51
        $cache = [