Code Duplication    Length = 9-10 lines in 2 locations

src/MemcachedCache.php 2 locations

@@ 44-52 (lines=9) @@
41
    /**
42
     * {@inheritDoc}
43
     */
44
    public function set($key, $value, $ttl = null)
45
    {
46
47
        $this->checkReservedCharacters($key);
48
        if ($ttl instanceof DateInterval) {
49
            $ttl = (new DateTime('now'))->add($ttl)->getTimeStamp() - time();
50
        }
51
        return $this->handler->set($key, $value, (int) $ttl);
52
    }
53
54
    /**
55
     * {@inheritDoc}
@@ 87-96 (lines=10) @@
84
    /**
85
     * {@inheritDoc}
86
     */
87
    public function setMultiple($values, $ttl = null)
88
    {
89
        foreach ($values as $key => $value) {
90
            $this->checkReservedCharacters($key);
91
        }
92
        if ($ttl instanceof DateInterval) {
93
            $ttl = (new DateTime('now'))->add($ttl)->getTimeStamp() - time();
94
        }
95
        return $this->handler->setMulti($values, (int) $ttl);
96
    }
97
98
    /**
99
     * {@inheritDoc}