aboutsummaryrefslogtreecommitdiff
path: root/lib/CacheInterface.php
diff options
context:
space:
mode:
authorGravatar logmanoriginal <logmanoriginal@users.noreply.github.com> 2018-11-16 21:48:59 +0100
committerGravatar logmanoriginal <logmanoriginal@users.noreply.github.com> 2018-11-18 09:41:14 +0100
commitc4550be812c238319c98c2de554cf69a01f3f355 (patch)
tree43956e62240c5540607b0dc2dfe1fa9a6fb03e1b /lib/CacheInterface.php
parentb29ba5b973694637642659e2bee80e0e4383b58a (diff)
downloadrss-bridge-c4550be812c238319c98c2de554cf69a01f3f355.tar.gz
rss-bridge-c4550be812c238319c98c2de554cf69a01f3f355.tar.zst
rss-bridge-c4550be812c238319c98c2de554cf69a01f3f355.zip
lib: Add API documentation
Diffstat (limited to 'lib/CacheInterface.php')
-rw-r--r--lib/CacheInterface.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/CacheInterface.php b/lib/CacheInterface.php
index 5753c0eb..bd2d5613 100644
--- a/lib/CacheInterface.php
+++ b/lib/CacheInterface.php
@@ -1,7 +1,51 @@
<?php
+/**
+ * This file is part of RSS-Bridge, a PHP project capable of generating RSS and
+ * Atom feeds for websites that don't have one.
+ *
+ * For the full license information, please view the UNLICENSE file distributed
+ * with this source code.
+ *
+ * @package Core
+ * @license http://unlicense.org/ UNLICENSE
+ * @link https://github.com/rss-bridge/rss-bridge
+ */
+
+/**
+ * The cache interface
+ *
+ * @todo Add missing function to the interface
+ * @todo Explain parameters and return values in more detail
+ * @todo Return self more often (to allow call chaining)
+ */
interface CacheInterface {
+
+ /**
+ * Loads data from cache
+ *
+ * @return mixed The cache data
+ */
public function loadData();
+
+ /**
+ * Stores data to the cache
+ *
+ * @param mixed $datas The data to store
+ * @return self The cache object
+ */
public function saveData($datas);
+
+ /**
+ * Returns the timestamp for the curent cache file
+ *
+ * @return int Timestamp
+ */
public function getTime();
+
+ /**
+ * Removes any data that is older than the specified duration from cache
+ *
+ * @param int $duration The cache duration in seconds
+ */
public function purgeCache($duration);
}