Permalink
Browse files

Update comments to specify when a method is returning a Closure

  • Loading branch information...
svemir authored and nateabele committed Jan 11, 2011
1 parent 19c1977 commit 536efae292f3074688eaf16209ba90307ba0f597
@@ -63,7 +63,7 @@ public function __construct(array $config = array()) {
*
* @param string $type
* @param string $message
- * @return boolean True on successful write, false otherwise.
+ * @return closure Function returning boolean `true` on successful write, `false` otherwise.
*/
public function write($type, $message) {
$config = $this->_config + $this->_classes;
@@ -67,7 +67,7 @@ public function __construct(array $config = array()) {
* @see lithium\analysis\Logger::$_priorities
* @param string $priority The message priority. See `Logger::$_priorities`.
* @param string $message The message to write to the log.
- * @return closure Returns a closure that writes to the log, which can be wrapped in filters.
+ * @return closure Function returning boolean `true` on successful write, `false` otherwise.
*/
public function write($priority, $message) {
$config = $this->_config;
@@ -122,7 +122,7 @@ public function __construct(array $config = array()) {
* @param string $message Message to be shown.
* @param array $options Any options that are passed to the `notify()` method. See the
* `$options` parameter of `notify()`.
- * @return boolean `True` on successful write, `false` otherwise.
+ * @return closure Function returning boolean `true` on successful write, `false` otherwise.
*/
public function write($type, $message, array $options = array()) {
$_self =& $this;
@@ -65,7 +65,7 @@ public function __construct(array $config = array()) {
*
* @param string $priority The message priority string. Maps to a `syslogd` priority constant.
* @param string $message The message to write.
- * @return boolean Returns `true` on successful write, `false` otherwise.
+ * @return closure Function returning boolean `true` on successful write, `false` otherwise.
*/
public function write($priority, $message) {
$config = $this->_config;
@@ -64,7 +64,7 @@ public function __construct(array $config = array()) {
* @param mixed $data The value to be cached.
* @param null|string $expiry A strtotime() compatible cache time. If no expiry time is set,
* then the default cache expiration time set with the cache configuration will be used.
- * @return boolean True on successful write, false otherwise.
+ * @return closure Function returning boolean `true` on successful write, `false` otherwise.
*/
public function write($key, $data, $expiry = null) {
$expiry = ($expiry) ?: $this->_config['expiry'];
@@ -88,7 +88,7 @@ public function write($key, $data, $expiry = null) {
* containing key/value pairs of the requested data.
*
* @param string|array $key The key to uniquely identify the cached item.
- * @return mixed Cached value if successful, false otherwise.
+ * @return closure Function returning cached value on successful read, `false` otherwise.
*/
public function read($key) {
return function($self, $params) {
@@ -104,7 +104,7 @@ public function read($key) {
* from the user space cache.
*
* @param string|array $key The key to uniquely identify the cached item.
- * @return mixed True on successful delete, false otherwise.
+ * @return closure Function returning `true` on successful delete, `false` otherwise.
*/
public function delete($key) {
return function($self, $params) {
@@ -121,7 +121,7 @@ public function delete($key) {
*
* @param string $key Key of numeric cache item to decrement
* @param integer $offset Offset to decrement - defaults to 1.
- * @return mixed Item's new value on successful decrement, false otherwise
+ * @return closure Function returning item's new value on successful decrement, `false` otherwise
*/
public function decrement($key, $offset = 1) {
return function($self, $params) use ($offset) {
@@ -138,7 +138,7 @@ public function decrement($key, $offset = 1) {
*
* @param string $key Key of numeric cache item to increment
* @param integer $offset Offset to increment - defaults to 1.
- * @return mixed Item's new value on successful increment, false otherwise
+ * @return closure Function returning item's new value on successful increment, `false` otherwise
*/
public function increment($key, $offset = 1) {
return function($self, $params) use ($offset) {
@@ -159,7 +159,7 @@ public function clear() {
* Determines if the APC extension has been installed and
* if the userspace cache is available.
*
- * return boolean True if enabled, false otherwise
+ * @return boolean `true` if enabled, `false` otherwise
*/
public static function enabled() {
$loaded = extension_loaded('apc');
@@ -67,7 +67,7 @@ public function __construct(array $config = array()) {
* @param mixed $data The value to be cached.
* @param null|string $expiry A strtotime() compatible cache time. If no expiry time is set,
* then the default cache expiration time set with the cache configuration will be used.
- * @return boolean True on successful write, false otherwise.
+ * @return closure Function returning boolean `true` on successful write, `false` otherwise.
*/
public function write($key, $data, $expiry = null) {
$path = $this->_config['path'];
@@ -85,7 +85,7 @@ public function write($key, $data, $expiry = null) {
* Read value(s) from the cache.
*
* @param string $key The key to uniquely identify the cached item.
- * @return mixed Cached value if successful, false otherwise.
+ * @return closure Function returning cached value if successful, `false` otherwise.
*/
public function read($key) {
$path = $this->_config['path'];
@@ -115,7 +115,7 @@ public function read($key) {
* Delete an entry from the cache.
*
* @param string $key The key to uniquely identify the cached item.
- * @return mixed True on successful delete, false otherwise.
+ * @return closure Function returning boolean `true` on successful delete, `false` otherwise.
*/
public function delete($key) {
$path = $this->_config['path'];
@@ -150,7 +150,7 @@ protected function _formatHostList($host) {
* @param mixed $expiry A Unix timestamp or `strtotime()`-compatible string indicating when
* `$value` should expire. If no expiry time is set, then the default cache
* expiration time set with the cache configuration will be used.
- * @return boolean Returns `true` on a successful write, `false` otherwise.
+ * @return closure Function returning boolean `true` on successful write, `false` otherwise.
*/
public function write($key, $value, $expiry = null) {
$connection =& $this->connection;
@@ -175,7 +175,7 @@ public function write($key, $value, $expiry = null) {
* containing key/value pairs of the requested data.
*
* @param string|array $key The key to uniquely identify the cached item.
- * @return mixed Cached value if successful, false otherwise.
+ * @return closure Function returning cached value if successful, `null` otherwise.
*/
public function read($key) {
$connection =& $this->connection;
@@ -199,7 +199,7 @@ public function read($key) {
* Delete value from the cache.
*
* @param string $key The key to uniquely identify the cached item.
- * @return mixed True on successful delete, false otherwise.
+ * @return closure Function returning `true` on successful delete, `false` otherwise.
*/
public function delete($key) {
$connection =& $this->connection;
@@ -219,7 +219,7 @@ public function delete($key) {
*
* @param string $key Key of numeric cache item to decrement
* @param integer $offset Offset to decrement - defaults to 1.
- * @return mixed Item's new value on successful decrement, false otherwise
+ * @return closure Function returning item's new value on successful decrement, `false` otherwise
*/
public function decrement($key, $offset = 1) {
$connection =& $this->connection;
@@ -238,7 +238,7 @@ public function decrement($key, $offset = 1) {
*
* @param string $key Key of numeric cache item to increment
* @param integer $offset Offset to increment - defaults to 1.
- * @return mixed Item's new value on successful increment, false otherwise
+ * @return closure Function returning item's new value on successful increment, `false` otherwise
*/
public function increment($key, $offset = 1) {
$connection =& $this->connection;
@@ -50,7 +50,7 @@ public function __get($variable) {
* note that this is not an atomic operation.
*
* @param string $key The key to uniquely identify the cached item.
- * @return mixed Cached value if successful, false otherwise.
+ * @return closure Function returning cached value if successful, `false` otherwise.
* @todo Refactor to use RES_NOTFOUND for return value checks.
*/
public function read($key) {
@@ -82,7 +82,7 @@ public function read($key) {
* @param string $key The key to uniquely identify the cached item.
* @param mixed $data The value to be cached.
* @param string $expiry A strtotime() compatible cache time.
- * @return boolean True on successful write, false otherwise.
+ * @return closure Function returning boolean `true` on successful write, `false` otherwise.
*/
public function write($key, $data, $expiry) {
$cache =& $this->_cache;
@@ -104,7 +104,7 @@ public function write($key, $data, $expiry) {
* Delete value from the cache
*
* @param string $key The key to uniquely identify the cached item.
- * @return mixed True on successful delete, false otherwise.
+ * @return closure Function returning boolean `true` on successful delete, `false` otherwise.
*/
public function delete($key) {
$cache =& $this->_cache;
@@ -125,7 +125,7 @@ public function delete($key) {
*
* @param string $key Key of numeric cache item to decrement.
* @param integer $offset Offset to decrement - defaults to 1.
- * @return mixed Item's new value on successful decrement, false otherwise.
+ * @return closure Function returning item's new value on successful decrement, `false` otherwise.
*/
public function decrement($key, $offset = 1) {
$cache =& $this->_cache;
@@ -141,7 +141,7 @@ public function decrement($key, $offset = 1) {
*
* @param string $key Key of numeric cache item to increment.
* @param integer $offset Offset to increment - defaults to 1.
- * @return mixed Item's new value on successful increment, false otherwise.
+ * @return closure Function returning item's new value on successful increment, `false` otherwise.
*/
public function increment($key, $offset = 1) {
$cache =& $this->_cache;
@@ -119,7 +119,7 @@ protected function _ttl($key, $expiry) {
* @param mixed $value The value to be cached
* @param null|string $expiry A strtotime() compatible cache time. If no expiry time is set,
* then the default cache expiration time set with the cache configuration will be used.
- * @return boolean True on successful write, false otherwise
+ * @return closure Function returning boolean `true` on successful write, `false` otherwise.
*/
public function write($key, $value = null, $expiry = null) {
$connection =& $this->connection;
@@ -154,7 +154,7 @@ public function write($key, $value = null, $expiry = null) {
* Read value(s) from the cache
*
* @param string $key The key to uniquely identify the cached item
- * @return mixed Cached value if successful, false otherwise
+ * @return closure Function returning cached value if successful, `false` otherwise
*/
public function read($key) {
$connection =& $this->connection;
@@ -173,7 +173,7 @@ public function read($key) {
* Delete value from the cache
*
* @param string $key The key to uniquely identify the cached item
- * @return mixed True on successful delete, false otherwise
+ * @return closure Function returning boolean `true` on successful delete, `false` otherwise
*/
public function delete($key) {
$connection =& $this->connection;
@@ -192,7 +192,7 @@ public function delete($key) {
*
* @param string $key Key of numeric cache item to decrement
* @param integer $offset Offset to decrement - defaults to 1.
- * @return mixed Item's new value on successful decrement, false otherwise
+ * @return closure Function returning item's new value on successful decrement, `false` otherwise
*/
public function decrement($key, $offset = 1) {
$connection =& $this->connection;
@@ -211,7 +211,7 @@ public function decrement($key, $offset = 1) {
*
* @param string $key Key of numeric cache item to increment
* @param integer $offset Offset to increment - defaults to 1.
- * @return mixed Item's new value on successful increment, false otherwise
+ * @return closure Function returning item's new value on successful increment, `false` otherwise
*/
public function increment($key, $offset = 1) {
$connection =& $this->connection;
@@ -63,7 +63,7 @@ public function __construct(array $config = array()) {
* @param mixed $data The value to be cached
* @param null|string $expiry A strtotime() compatible cache time. If no expiry time is set,
* then the default cache expiration time set with the cache configuration will be used.
- * @return boolean True on successful write, false otherwise
+ * @return closure Function returning boolean `true` on successful write, `false` otherwise.
*/
public function write($key, $data, $expiry = null) {
$expiry = ($expiry) ?: $this->_config['expiry'];
@@ -76,8 +76,8 @@ public function write($key, $data, $expiry = null) {
/**
* Read value(s) from the cache
*
- * @param string $key The key to uniquely identify the cached item
- * @return mixed Cached value if successful, false otherwise
+ * @param string $key The key to uniquely identify the cached item
+ * @return closure Function returning cached value if successful, `false` otherwise
*/
public function read($key) {
return function($self, $params) {
@@ -88,8 +88,8 @@ public function read($key) {
/**
* Delete value from the cache
*
- * @param string $key The key to uniquely identify the cached item
- * @return mixed True on successful delete, false otherwise
+ * @param string $key The key to uniquely identify the cached item
+ * @return closure Function returning boolean `true` on successful delete, `false` otherwise
*/
public function delete($key) {
return function($self, $params) {
@@ -106,7 +106,7 @@ public function delete($key) {
*
* @param string $key Key of numeric cache item to decrement
* @param integer $offset Offset to decrement - defaults to 1.
- * @return mixed Item's new value on successful decrement, false otherwise
+ * @return closure Function returning item's new value on successful decrement, `false` otherwise
*/
public function decrement($key, $offset = 1) {
return function($self, $params) use ($offset) {
@@ -122,7 +122,7 @@ public function decrement($key, $offset = 1) {
*
* @param string $key Key of numeric cache item to increment
* @param integer $offset Offset to increment - defaults to 1.
- * @return mixed Item's new value on successful increment, false otherwise
+ * @return closure Function returning item's new value on successful increment, `false` otherwise
*/
public function increment($key, $offset = 1) {
return function($self, $params) use ($offset) {
@@ -90,7 +90,7 @@ public function isStarted() {
* Checks if a value has been set in the cookie.
*
* @param string $key Key of the entry to be checked.
- * @return boolean True if the key exists, false otherwise.
+ * @return closure Function returning boolean `true` if the key exists, `false` otherwise.
*/
public function check($key) {
$config = $this->_config;
@@ -106,7 +106,7 @@ public function check($key) {
* @param null|string $key Key of the entry to be read. If $key is null, returns
* all cookie key/value pairs that have been set.
* @param array $options Options array. Not used in this adapter.
- * @return mixed Data in the session if successful, null otherwise.
+ * @return closure Function returning data in the session if successful, `null` otherwise.
*/
public function read($key = null, array $options = array()) {
$config = $this->_config;
@@ -142,7 +142,7 @@ public function read($key = null, array $options = array()) {
* @param string $key Key of the item to be stored.
* @param mixed $value The value to be stored.
* @param array $options Options array.
- * @return boolean True on successful write, false otherwise.
+ * @return closure Function returning boolean `true` on successful write, `false` otherwise.
*/
public function write($key, $value = null, array $options = array()) {
$expire = (!isset($options['expire']) && empty($this->_config['expire']));
@@ -181,7 +181,7 @@ public function write($key, $value = null, array $options = array()) {
*
* @param string $key The key to be deleted from the cookie store.
* @param array $options Options array.
- * @return boolean True on successful delete, false otherwise.
+ * @return closure Function returning boolean `true` on successful delete, `false` otherwise.
*/
public function delete($key, array $options = array()) {
$config = $this->_config;
@@ -47,7 +47,7 @@ public function isStarted() {
*
* @param string $key Key of the entry to be checked.
* @param array $options Options array. Not used for this adapter method.
- * @return boolean True if the key exists, false otherwise.
+ * @return closure Function returning boolean `true` if the key exists, `false` otherwise.
*/
public function check($key, array $options = array()) {
$session =& $this->_session;
@@ -62,7 +62,7 @@ public function check($key, array $options = array()) {
* @param null|string $key Key of the entry to be read. If no key is passed, all
* current session data is returned.
* @param array $options Options array. Not used for this adapter method.
- * @return mixed Data in the session if successful, false otherwise.
+ * @return closure Function returning data in the session if successful, `false` otherwise.
*/
public function read($key = null, array $options = array()) {
$session = $this->_session;
@@ -83,7 +83,7 @@ public function read($key = null, array $options = array()) {
* @param string $key Key of the item to be stored.
* @param mixed $value The value to be stored.
* @param array $options Options array. Not used for this adapter method.
- * @return boolean True on successful write, false otherwise
+ * @return closure Function returning boolean `true` on successful write, `false` otherwise.
*/
public function write($key, $value, array $options = array()) {
$session =& $this->_session;
@@ -99,7 +99,7 @@ public function write($key, $value, array $options = array()) {
*
* @param string $key The key to be deleted
* @param array $options Options array. Not used for this adapter method.
- * @return boolean True on successful delete, false otherwise
+ * @return closure Function returning boolean `true` on successful delete, `false` otherwise
*/
public function delete($key, array $options = array()) {
$session =& $this->_session;
@@ -113,7 +113,8 @@ public function delete($key, array $options = array()) {
/**
* Clears all keys from the session.
*
- * @param array $options Options array. Not used fro this adapter method.
+ * @param array $options Options array. Not used for this adapter method.
+ * @return closure Function that clears the session
*/
public function clear(array $options = array()) {
$session =& $this->_session;
Oops, something went wrong.

0 comments on commit 536efae

Please sign in to comment.