Code Duplication    Length = 12-13 lines in 2 locations

src/Adapter/Memcached.php 1 location

@@ 70-82 (lines=13) @@
67
	 *
68
	 * @since   1.0
69
	 */
70
	public function getItem($key)
71
	{
72
		$value = $this->driver->get($key);
73
		$code = $this->driver->getResultCode();
74
		$item = new Item($key);
75
76
		if ($code === \Memcached::RES_SUCCESS)
77
		{
78
			$item->set($value);
79
		}
80
81
		return $item;
82
	}
83
84
	/**
85
	 * Method to remove a storage entry for a key.

src/Adapter/Redis.php 1 location

@@ 69-80 (lines=12) @@
66
	 *
67
	 * @since   1.0
68
	 */
69
	public function getItem($key)
70
	{
71
		$value = $this->driver->get($key);
72
		$item = new Item($key);
73
74
		if ($value !== false)
75
		{
76
			$item->set($value);
77
		}
78
79
		return $item;
80
	}
81
82
	/**
83
	 * Method to remove a storage entry for a key.