INFRA-132 - CRM/ - PHPStorm cleanup
[civicrm-core.git] / CRM / Utils / Recent.php
index 504ad85826fea35a122bdf8d87ea43c59961d51b..ec8378798b700316e3ada794eb3ee38316908061 100644 (file)
@@ -2,7 +2,7 @@
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
 class CRM_Utils_Recent {
 
   /**
-   * max number of items in queue
+   * Max number of items in queue
    *
    * @int
    */
-  CONST MAX_ITEMS = 10, STORE_NAME = 'CRM_Utils_Recent';
+  const MAX_ITEMS = 10, STORE_NAME = 'CRM_Utils_Recent';
 
   /**
    * The list of recently viewed items
@@ -55,13 +55,12 @@ class CRM_Utils_Recent {
   static private $_recent = NULL;
 
   /**
-   * initialize this class and set the static variables
+   * Initialize this class and set the static variables
    *
    * @return void
-   * @access public
    * @static
    */
-  static function initialize() {
+  public static function initialize() {
     if (!self::$_recent) {
       $session = CRM_Core_Session::singleton();
       self::$_recent = $session->get(self::STORE_NAME);
@@ -72,35 +71,36 @@ class CRM_Utils_Recent {
   }
 
   /**
-   * return the recently viewed array
+   * Return the recently viewed array
    *
-   * @return array the recently viewed array
-   * @access public
+   * @return array
+   *   the recently viewed array
    * @static
    */
-  static function &get() {
+  public static function &get() {
     self::initialize();
     return self::$_recent;
   }
 
   /**
-   * add an item to the recent stack
-   *
-   * @param string $title the title to display
-   * @param string $url the link for the above title
-   * @param string $id object id
+   * Add an item to the recent stack
    *
+   * @param string $title
+   *   The title to display.
+   * @param string $url
+   *   The link for the above title.
+   * @param string $id
+   *   Object id.
    * @param $type
-   * @param $contactId
-   * @param $contactName
+   * @param int $contactId
+   * @param string $contactName
    * @param array $others
    *
-   * @internal param string $icon a link to a graphical image
    * @return void
-   * @access public
    * @static
    */
-  static function add($title,
+  static function add(
+    $title,
     $url,
     $id,
     $type,
@@ -149,15 +149,15 @@ class CRM_Utils_Recent {
   }
 
   /**
-   * delete an item from the recent stack
+   * Delete an item from the recent stack
    *
-   * @param array $recentItem array of the recent Item to be removed
+   * @param array $recentItem
+   *   Array of the recent Item to be removed.
    *
    * @return void
-   * @access public
    * @static
    */
-  static function del($recentItem) {
+  public static function del($recentItem) {
     self::initialize();
     $tempRecent = self::$_recent;
 
@@ -166,8 +166,9 @@ class CRM_Utils_Recent {
     // make sure item is not already present in list
     for ($i = 0; $i < count($tempRecent); $i++) {
       if (!($tempRecent[$i]['id'] == $recentItem['id'] &&
-          $tempRecent[$i]['type'] == $recentItem['type']
-        )) {
+        $tempRecent[$i]['type'] == $recentItem['type']
+      )
+      ) {
         self::$_recent[] = $tempRecent[$i];
       }
     }
@@ -177,15 +178,15 @@ class CRM_Utils_Recent {
   }
 
   /**
-   * delete an item from the recent stack
+   * Delete an item from the recent stack
    *
-   * @param string $id  contact id that had to be removed
+   * @param string $id
+   *   Contact id that had to be removed.
    *
    * @return void
-   * @access public
    * @static
    */
-  static function delContact($id) {
+  public static function delContact($id) {
     self::initialize();
 
     $tempRecent = self::$_recent;
@@ -205,4 +206,3 @@ class CRM_Utils_Recent {
     $session->set(self::STORE_NAME, self::$_recent);
   }
 }
-