<?php

namespace Engine\Cache;


/**
 * The class is a dummy instance (it does not store or retrieve anything).
 * @author Gabriel Grosu
 */
class Dummy implements \Engine\Cache\BaseInterface
{

	/**
	 * Sets a value in the cache for a certain key.
	 * @param String $key
	 * @param Mixed $value
	 * @param String $expireTime
	 * @return Boolean - indicating if the key was correctly saved in the cache
	 */
	public function set($key, $value, $expireTime=0) :void
	{
	}

	/**
	 * Gets a value stored in the cache for a certain key.
	 * @param String $key
	 * @return Mixed - the stored value or null if the key was not found
	 */
	public function get($key)
	{
		return null;
	}

	/**
	 * Deletes the value stored in the cache for a certain key.
	 * @param String $key
	 * @return Boolean - indicating if the key was correctly deleted in the cache
	 */
	public function delete($key) :void
	{ }

	/**
	 * Deletes the whole cache content.
	 * @return Boolean - indicating if the cache was completely destroyed
	 * @see \Engine\Cache\BaseInterface::flush()
	 */
	public function flush() :bool
	{
		return true;
	}

	/**
	 * Returns an associative array of details for a certain ke.
	 * @return Array
	 */
	public function getInfo($key)
	{
		$return = [
			'key' => 	$key,
			'exists' => false,
		];

		return $return;
	}

}

