INFRA-132 - CRM/Upgrade - Convert single-line @param to multi-line
[civicrm-core.git] / CRM / Utils / Cache / Memcached.php
index 9962f7bf8fb4123cb0ce9390b2bd7608dd48f08e..e5ce5d792a92417cb877772892c7a2beb85f9de9 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -81,10 +81,11 @@ class CRM_Utils_Cache_Memcached {
   /**
    * Constructor
    *
-   * @param array   $config  an array of configuration params
-   * @return void
+   * @param array $config an array of configuration params
+   *
+   * @return \CRM_Utils_Cache_Memcached
    */
-  function __construct($config) {
+  public function __construct($config) {
     if (isset($config['host'])) {
       $this->_host = $config['host'];
     }
@@ -107,7 +108,14 @@ class CRM_Utils_Cache_Memcached {
     }
   }
 
-  function set($key, &$value) {
+  /**
+   * @param $key
+   * @param $value
+   *
+   * @return bool
+   * @throws Exception
+   */
+  public function set($key, &$value) {
     $key = $this->cleanKey($key);
     if (!$this->_cache->set($key, $value, $this->_timeout)) {
       CRM_Core_Error::debug( 'Result Code: ', $this->_cache->getResultMessage());
@@ -117,18 +125,33 @@ class CRM_Utils_Cache_Memcached {
     return TRUE;
   }
 
-  function &get($key) {
+  /**
+   * @param $key
+   *
+   * @return mixed
+   */
+  public function &get($key) {
     $key = $this->cleanKey($key);
     $result = $this->_cache->get($key);
     return $result;
   }
 
-  function delete($key) {
+  /**
+   * @param $key
+   *
+   * @return mixed
+   */
+  public function delete($key) {
     $key = $this->cleanKey($key);
     return $this->_cache->delete($key);
   }
 
-  function cleanKey($key) {
+  /**
+   * @param $key
+   *
+   * @return mixed|string
+   */
+  public function cleanKey($key) {
     $key = preg_replace('/\s+|\W+/', '_', $this->_prefix . $key);
     if ( strlen($key) > self::MAX_KEY_LEN ) {
       $md5Key = md5($key);  // this should be 32 characters in length
@@ -138,7 +161,10 @@ class CRM_Utils_Cache_Memcached {
     return $key;
   }
 
-  function flush() {
+  /**
+   * @return mixed
+   */
+  public function flush() {
     return $this->_cache->flush();
   }
 }