Code Duplication    Length = 8-8 lines in 2 locations

src/MongoCache.php 1 location

@@ 51-58 (lines=8) @@
48
    {
49
        Util::throwIfNotType(['int' => [$expires]], false, true);
50
51
        if ($expires === null) {
52
            $expiresHeader = null;
53
            if (!Arrays::tryGet($response->getResponseHeaders(), 'Expires', $expiresHeader)) {
54
                return;
55
            }
56
57
            $expires = Util::ensureNot(
58
                false,
59
                strtotime($expiresHeader[0]),
60
                "Unable to parse Expires value of '{$expiresHeader[0]}'"
61
            );

src/PredisCache.php 1 location

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