Code Duplication    Length = 11-11 lines in 2 locations

src/phpFastCache/Drivers/Leveldb/Driver.php 1 location

@@ 80-90 (lines=11) @@
77
     * @return mixed
78
     * @throws \InvalidArgumentException
79
     */
80
    protected function driverWrite(CacheItemInterface $item)
81
    {
82
        /**
83
         * Check for Cross-Driver type confusion
84
         */
85
        if ($item instanceof Item) {
86
            return $this->instance->set($item->getKey(), $this->encode($this->driverPreWrap($item)));
87
        } else {
88
            throw new \InvalidArgumentException('Cross-Driver type confusion detected');
89
        }
90
    }
91
92
    /**
93
     * @param \Psr\Cache\CacheItemInterface $item

src/phpFastCache/Drivers/Memstatic/Driver.php 1 location

@@ 64-74 (lines=11) @@
61
     * @return mixed
62
     * @throws \InvalidArgumentException
63
     */
64
    protected function driverWrite(CacheItemInterface $item)
65
    {
66
        /**
67
         * Check for Cross-Driver type confusion
68
         */
69
        if ($item instanceof Item) {
70
            return $this->staticStack[md5($item->getKey())] = $this->driverPreWrap($item);
71
        } else {
72
            throw new \InvalidArgumentException('Cross-Driver type confusion detected');
73
        }
74
    }
75
76
    /**
77
     * @param \Psr\Cache\CacheItemInterface $item