CRM-15683 - CRM_Core_Invoke - Cleanup comments. Remove duplicate code.
[civicrm-core.git] / CRM / Core / Action.php
index 65c264b7f3657a154072a159c1a2983a41983488..6c505b179726a89af8f8e3276760760982a4bde9 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -41,11 +41,10 @@ class CRM_Core_Action {
    * Different possible actions are defined here. Keep in sync with the
    * constant from CRM_Core_Form for various modes.
    *
-   * @var const
+   * @var integer const
    *
-   * @access public
    */
-  CONST
+  const
     NONE = 0,
     ADD = 1,
     UPDATE = 2,
@@ -72,13 +71,12 @@ class CRM_Core_Action {
   //make sure MAX_ACTION = 2^n - 1 ( n = total number of actions )
 
   /**
-   * map the action names to the relevant constant. We perform
+   * Map the action names to the relevant constant. We perform
    * bit manipulation operations so we can perform multiple
    * actions on the same object if needed
    *
-   * @var array  _names  tupe of variable name to action constant
+   * @var array $_names  type of variable name to action constant
    *
-   * @access private
    * @static
    *
    */
@@ -103,7 +101,7 @@ class CRM_Core_Action {
   );
 
   /**
-   * the flipped version of the names array, initialized when used
+   * The flipped version of the names array, initialized when used
    *
    * @var array
    * @static
@@ -111,18 +109,14 @@ class CRM_Core_Action {
   static $_description;
 
   /**
+   * Called by the request object to translate a string into a mask
    *
-   * called by the request object to translate a string into a mask
-   *
-   * @param $str
-   *
-   * @internal param string $action the action to be resolved
+   * @param string $str the action to be resolved
    *
    * @return int the action mask corresponding to the input string
-   * @access public
    * @static
    */
-  static function resolve($str) {
+  public static function resolve($str) {
     $action = 0;
     if ($str) {
       $items = explode('|', $str);
@@ -135,14 +129,13 @@ class CRM_Core_Action {
    * Given a string or an array of strings, determine the bitmask
    * for this set of actions
    *
-   * @param mixed either a single string or an array of strings
+   * @param mixed $item either a single string or an array of strings
    *
    * @return int the action mask corresponding to the input args
-   * @access public
    * @static
    *
    */
-  static function map($item) {
+  public static function map($item) {
     $mask = 0;
 
     if (is_array($item)) {
@@ -159,14 +152,13 @@ class CRM_Core_Action {
   /**
    * Given a string determine the bitmask for this specific string
    *
-   * @param string the input action to process
+   * @param string $item the input action to process
    *
    * @return int the action mask corresponding to the input string
-   * @access public
    * @static
    *
    */
-  static function mapItem($item) {
+  public static function mapItem($item) {
     $mask = CRM_Utils_Array::value(trim($item), self::$_names);
     return $mask ? $mask : 0;
   }
@@ -175,14 +167,13 @@ class CRM_Core_Action {
    *
    * Given an action mask, find the corresponding description
    *
-   * @param int the action mask
+   * @param int $mask the action mask
    *
    * @return string the corresponding action description
-   * @access public
    * @static
    *
    */
-  static function description($mask) {
+  public static function description($mask) {
     if (!isset($_description)) {
       self::$_description = array_flip(self::$_names);
     }
@@ -191,7 +182,7 @@ class CRM_Core_Action {
   }
 
   /**
-   * given a set of links and a mask, return the html action string for
+   * Given a set of links and a mask, return the html action string for
    * the links associated with the mask
    *
    * @param array $links the set of link items
@@ -202,10 +193,9 @@ class CRM_Core_Action {
    *
    * @param null $op
    * @param null $objectName
-   * @param null $objectId
+   * @param int $objectId
    *
    * @return string       the html string
-   * @access public
    * @static
    */
   static function formLink($links,
@@ -308,17 +298,16 @@ class CRM_Core_Action {
   }
 
   /**
-   * given a string and an array of values, substitute the real values
+   * Given a string and an array of values, substitute the real values
    * in the placeholder in the str in the CiviCRM format
    *
    * @param string $str    the string to be replaced
    * @param array  $values the array of values for parameter substitution in the str
    *
    * @return string        the substituted string
-   * @access public
    * @static
    */
-  static function &replace(&$str, &$values) {
+  public static function &replace(&$str, &$values) {
     foreach ($values as $n => $v) {
       $str = str_replace("%%$n%%", $v, $str);
     }
@@ -326,15 +315,14 @@ class CRM_Core_Action {
   }
 
   /**
-   * get the mask for a permission (view, edit or null)
+   * Get the mask for a permission (view, edit or null)
    *
    * @param string the permission
    *
    * @return int   the mask for the above permission
    * @static
-   * @access public
    */
-  static function mask($permissions) {
+  public static function mask($permissions) {
     $mask = NULL;
     if (!is_array($permissions) || CRM_Utils_System::isNull($permissions)) {
       return $mask;
@@ -355,4 +343,3 @@ class CRM_Core_Action {
     return $mask;
   }
 }
-