API - add field options to getoptions metadata
[civicrm-core.git] / CRM / Utils / Hook.php
index 14d36e5dbfe56b1f8b483f0c2d5b3c3e1e53b1f5..25dec213049ecbb47f03cf847a1cf9247692e185 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * $Id: $
  *
  */
-
 abstract class CRM_Utils_Hook {
 
   // Allowed values for dashboard hook content placement
   // Default - place content below activity list
-  CONST DASHBOARD_BELOW = 1;
+  const DASHBOARD_BELOW = 1;
   // Place content above activity list
-  CONST DASHBOARD_ABOVE = 2;
+  const DASHBOARD_ABOVE = 2;
   // Don't display activity list at all
-  CONST DASHBOARD_REPLACE = 3;
+  const DASHBOARD_REPLACE = 3;
 
   // by default - place content below existing content
-  CONST SUMMARY_BELOW = 1;
+  const SUMMARY_BELOW = 1;
   // pace hook content above
-  CONST SUMMARY_ABOVE = 2;
+  const SUMMARY_ABOVE = 2;
   // create your own summarys
-  CONST SUMMARY_REPLACE = 3;
+  const SUMMARY_REPLACE = 3;
 
   static $_nullObject = NULL;
 
@@ -57,7 +56,6 @@ abstract class CRM_Utils_Hook {
    * pattern and cache the instance in this variable
    *
    * @var object
-   * @static
    */
   static private $_singleton = NULL;
 
@@ -72,38 +70,47 @@ abstract class CRM_Utils_Hook {
   private $commonCiviModules = array();
 
   /**
-   * Constructor and getter for the singleton instance
+   * Constructor and getter for the singleton instance.
    *
    * @param bool $fresh
    *
    * @return self
    *   An instance of $config->userHookClass
    */
-  static function singleton($fresh = FALSE) {
+  public static function singleton($fresh = FALSE) {
     if (self::$_singleton == NULL || $fresh) {
       $config = CRM_Core_Config::singleton();
       $class = $config->userHookClass;
-      require_once (str_replace('_', DIRECTORY_SEPARATOR, $config->userHookClass) . '.php');
+      require_once str_replace('_', DIRECTORY_SEPARATOR, $config->userHookClass) . '.php';
       self::$_singleton = new $class();
     }
     return self::$_singleton;
   }
 
   /**
-   *Invoke hooks
+   * Invoke hooks.
    *
-   * @param int $numParams Number of parameters to pass to the hook
-   * @param mixed $arg1 parameter to be passed to the hook
-   * @param mixed $arg2 parameter to be passed to the hook
-   * @param mixed $arg3 parameter to be passed to the hook
-   * @param mixed $arg4 parameter to be passed to the hook
-   * @param mixed $arg5 parameter to be passed to the hook
-   * @param mixed $arg6 parameter to be passed to the hook
-   * @param string $fnSuffix function suffix, this is effectively the hook name
+   * @param int $numParams
+   *   Number of parameters to pass to the hook.
+   * @param mixed $arg1
+   *   Parameter to be passed to the hook.
+   * @param mixed $arg2
+   *   Parameter to be passed to the hook.
+   * @param mixed $arg3
+   *   Parameter to be passed to the hook.
+   * @param mixed $arg4
+   *   Parameter to be passed to the hook.
+   * @param mixed $arg5
+   *   Parameter to be passed to the hook.
+   * @param mixed $arg6
+   *   Parameter to be passed to the hook.
+   * @param string $fnSuffix
+   *   Function suffix, this is effectively the hook name.
    *
    * @return mixed
    */
-  abstract function invoke($numParams,
+  public abstract function invoke(
+    $numParams,
     &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
     $fnSuffix
   );
@@ -121,7 +128,8 @@ abstract class CRM_Utils_Hook {
    *
    * @return array|bool
    */
-  function commonInvoke($numParams,
+  public function commonInvoke(
+    $numParams,
     &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
     $fnSuffix, $fnPrefix
   ) {
@@ -138,7 +146,7 @@ abstract class CRM_Utils_Hook {
    *
    * @param string $fnPrefix
    */
-  function commonBuildModuleList($fnPrefix) {
+  public function commonBuildModuleList($fnPrefix) {
     if (!$this->commonIncluded) {
       // include external file
       $this->commonIncluded = TRUE;
@@ -147,7 +155,7 @@ abstract class CRM_Utils_Hook {
       if (!empty($config->customPHPPathDir) &&
         file_exists("{$config->customPHPPathDir}/civicrmHooks.php")
       ) {
-        @include_once ("civicrmHooks.php");
+        @include_once "civicrmHooks.php";
       }
 
       if (!empty($fnPrefix)) {
@@ -171,7 +179,8 @@ abstract class CRM_Utils_Hook {
    *
    * @return array|bool
    */
-  function runHooks($civiModules, $fnSuffix, $numParams,
+  public function runHooks(
+    $civiModules, $fnSuffix, $numParams,
     &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6
   ) {
     // $civiModules is *not* passed by reference because runHooks
@@ -220,7 +229,8 @@ abstract class CRM_Utils_Hook {
           }
 
           if (!empty($fResult) &&
-            is_array($fResult)) {
+            is_array($fResult)
+          ) {
             $result = array_merge($result, $fResult);
           }
         }
@@ -233,200 +243,262 @@ abstract class CRM_Utils_Hook {
   /**
    * @param $moduleList
    */
-  function requireCiviModules(&$moduleList) {
+  public function requireCiviModules(&$moduleList) {
     $civiModules = CRM_Core_PseudoConstant::getModuleExtensions();
     foreach ($civiModules as $civiModule) {
       if (!file_exists($civiModule['filePath'])) {
         CRM_Core_Session::setStatus(
-          ts( 'Error loading module file (%1). Please restore the file or disable the module.',
-            array(1 => $civiModule['filePath']) ),
-          ts( 'Warning'), 'error');
+          ts('Error loading module file (%1). Please restore the file or disable the module.',
+            array(1 => $civiModule['filePath'])),
+          ts('Warning'), 'error');
         continue;
       }
       include_once $civiModule['filePath'];
       $moduleList[$civiModule['prefix']] = $civiModule['prefix'];
-      }
     }
+  }
 
   /**
    * This hook is called before a db write on some core objects.
    * This hook does not allow the abort of the operation
    *
-   * @param string $op         the type of operation being performed
-   * @param string $objectName the name of the object
-   * @param int $id         the object id if available
-   * @param array  $params     the parameters used for object creation / editing
+   * @param string $op
+   *   The type of operation being performed.
+   * @param string $objectName
+   *   The name of the object.
+   * @param int $id
+   *   The object id if available.
+   * @param array $params
+   *   The parameters used for object creation / editing.
    *
-   * @return null the return value is ignored
+   * @return null
+   *   the return value is ignored
    */
-  static function pre($op, $objectName, $id, &$params) {
+  public static function pre($op, $objectName, $id, &$params) {
     $event = new \Civi\Core\Event\PreEvent($op, $objectName, $id, $params);
     \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_pre", $event);
     \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_pre::$objectName", $event);
-    return self::singleton()->invoke(4, $op, $objectName, $id, $params, self::$_nullObject, self::$_nullObject, 'civicrm_pre');
+    return self::singleton()
+      ->invoke(4, $op, $objectName, $id, $params, self::$_nullObject, self::$_nullObject, 'civicrm_pre');
   }
 
   /**
    * This hook is called after a db write on some core objects.
    *
-   * @param string $op         the type of operation being performed
-   * @param string $objectName the name of the object
-   * @param int    $objectId   the unique identifier for the object
-   * @param object $objectRef  the reference to the object if available
+   * @param string $op
+   *   The type of operation being performed.
+   * @param string $objectName
+   *   The name of the object.
+   * @param int $objectId
+   *   The unique identifier for the object.
+   * @param object $objectRef
+   *   The reference to the object if available.
    *
-   * @return mixed             based on op. pre-hooks return a boolean or
+   * @return mixed
+   *   based on op. pre-hooks return a boolean or
    *                           an error message which aborts the operation
-   * @access public
    */
-  static function post($op, $objectName, $objectId, &$objectRef) {
+  public static function post($op, $objectName, $objectId, &$objectRef) {
     $event = new \Civi\Core\Event\PostEvent($op, $objectName, $objectId, $objectRef);
     \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_post", $event);
     \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_post::$objectName", $event);
-    return self::singleton()->invoke(4, $op, $objectName, $objectId, $objectRef, self::$_nullObject, self::$_nullObject, 'civicrm_post');
+    return self::singleton()
+      ->invoke(4, $op, $objectName, $objectId, $objectRef, self::$_nullObject, self::$_nullObject, 'civicrm_post');
   }
 
   /**
-   * This hook retrieves links from other modules and injects it into
+   * This hook retrieves links from other modules and injects it into.
    * the view contact tabs
    *
-   * @param string $op         the type of operation being performed
-   * @param string $objectName the name of the object
-   * @param int    $objectId   the unique identifier for the object
-   * @param array  $links      (optional) the links array (introduced in v3.2)
-   * @param int    $mask       (optional) the bitmask to show/hide links
-   * @param array  $values     (optional) the values to fill the links
+   * @param string $op
+   *   The type of operation being performed.
+   * @param string $objectName
+   *   The name of the object.
+   * @param int $objectId
+   *   The unique identifier for the object.
+   * @param array $links
+   *   (optional) the links array (introduced in v3.2).
+   * @param int $mask
+   *   (optional) the bitmask to show/hide links.
+   * @param array $values
+   *   (optional) the values to fill the links.
    *
-   * @return null  the return value is ignored
+   * @return null
+   *   the return value is ignored
    */
-  static function links($op, $objectName, &$objectId, &$links, &$mask = NULL, &$values = array()) {
+  public static function links($op, $objectName, &$objectId, &$links, &$mask = NULL, &$values = array()) {
     return self::singleton()->invoke(6, $op, $objectName, $objectId, $links, $mask, $values, 'civicrm_links');
   }
 
   /**
    * This hook is invoked during the CiviCRM form preProcess phase.
    *
-   * @param string $formName the name of the form
-   * @param CRM_Core_Form $form     reference to the form object
+   * @param string $formName
+   *   The name of the form.
+   * @param CRM_Core_Form $form
+   *   Reference to the form object.
    *
-   * @return null the return value is ignored
+   * @return null
+   *   the return value is ignored
    */
-  static function preProcess($formName, &$form) {
-    return self::singleton()->invoke(2, $formName, $form, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_preProcess');
+  public static function preProcess($formName, &$form) {
+    return self::singleton()
+      ->invoke(2, $formName, $form, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_preProcess');
   }
 
   /**
    * This hook is invoked when building a CiviCRM form. This hook should also
    * be used to set the default values of a form element
    *
-   * @param string $formName the name of the form
-   * @param CRM_Core_Form $form     reference to the form object
+   * @param string $formName
+   *   The name of the form.
+   * @param CRM_Core_Form $form
+   *   Reference to the form object.
    *
-   * @return null the return value is ignored
+   * @return null
+   *   the return value is ignored
    */
-  static function buildForm($formName, &$form) {
-    return self::singleton()->invoke(2, $formName, $form, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_buildForm');
+  public static function buildForm($formName, &$form) {
+    return self::singleton()->invoke(2, $formName, $form,
+      self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
+      'civicrm_buildForm'
+    );
   }
 
   /**
    * This hook is invoked when a CiviCRM form is submitted. If the module has injected
    * any form elements, this hook should save the values in the database
    *
-   * @param string $formName the name of the form
-   * @param CRM_Core_Form $form     reference to the form object
+   * @param string $formName
+   *   The name of the form.
+   * @param CRM_Core_Form $form
+   *   Reference to the form object.
    *
-   * @return null the return value is ignored
+   * @return null
+   *   the return value is ignored
    */
-  static function postProcess($formName, &$form) {
-    return self::singleton()->invoke(2, $formName, $form, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_postProcess');
+  public static function postProcess($formName, &$form) {
+    return self::singleton()->invoke(2, $formName, $form,
+      self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
+      'civicrm_postProcess'
+    );
   }
 
   /**
    * This hook is invoked during all CiviCRM form validation. An array of errors
    * detected is returned. Else we assume validation succeeded.
    *
-   * @param string $formName the name of the form
-   * @param array  &$fields   the POST parameters as filtered by QF
-   * @param array  &$files    the FILES parameters as sent in by POST
-   * @param array  &$form     the form object
+   * @param string $formName
+   *   The name of the form.
+   * @param array &$fields the POST parameters as filtered by QF
+   * @param array &$files the FILES parameters as sent in by POST
+   * @param array &$form the form object
    *
-   * @return mixed             formRule hooks return a boolean or
+   * @return mixed
+   *   formRule hooks return a boolean or
    *                           an array of error messages which display a QF Error
    */
-  static function validate($formName, &$fields, &$files, &$form) {
-    return self::singleton()->invoke(4, $formName, $fields, $files, $form, self::$_nullObject, self::$_nullObject, 'civicrm_validate');
+  public static function validate($formName, &$fields, &$files, &$form) {
+    return self::singleton()
+      ->invoke(4, $formName, $fields, $files, $form, self::$_nullObject, self::$_nullObject, 'civicrm_validate');
   }
 
   /**
    * This hook is invoked during all CiviCRM form validation. An array of errors
    * detected is returned. Else we assume validation succeeded.
    *
-   * @param string $formName  the name of the form
-   * @param array  &$fields   the POST parameters as filtered by QF
-   * @param array  &$files    the FILES parameters as sent in by POST
-   * @param array  &$form     the form object
-   * @param array &$errors    the array of errors.
+   * @param string $formName
+   *   The name of the form.
+   * @param array &$fields the POST parameters as filtered by QF
+   * @param array &$files the FILES parameters as sent in by POST
+   * @param array &$form the form object
+   * @param array &$errors the array of errors.
    *
-   * @return mixed             formRule hooks return a boolean or
+   * @return mixed
+   *   formRule hooks return a boolean or
    *                           an array of error messages which display a QF Error
    */
-  static function validateForm($formName, &$fields, &$files, &$form, &$errors) {
-    return self::singleton()->invoke(5, $formName, $fields, $files, $form, $errors, self::$_nullObject, 'civicrm_validateForm');
+  public static function validateForm($formName, &$fields, &$files, &$form, &$errors) {
+    return self::singleton()
+      ->invoke(5, $formName, $fields, $files, $form, $errors, self::$_nullObject, 'civicrm_validateForm');
   }
 
   /**
-   * This hook is called before a db write on a custom table
+   * This hook is called before a db write on a custom table.
    *
-   * @param string $op         the type of operation being performed
-   * @param string $groupID    the custom group ID
-   * @param object $entityID   the entityID of the row in the custom table
-   * @param array  $params     the parameters that were sent into the calling function
+   * @param string $op
+   *   The type of operation being performed.
+   * @param string $groupID
+   *   The custom group ID.
+   * @param object $entityID
+   *   The entityID of the row in the custom table.
+   * @param array $params
+   *   The parameters that were sent into the calling function.
    *
-   * @return null the return value is ignored
+   * @return null
+   *   the return value is ignored
    */
-  static function custom($op, $groupID, $entityID, &$params) {
-    return self::singleton()->invoke(4, $op, $groupID, $entityID, $params, self::$_nullObject, self::$_nullObject, 'civicrm_custom');
+  public static function custom($op, $groupID, $entityID, &$params) {
+    return self::singleton()
+      ->invoke(4, $op, $groupID, $entityID, $params, self::$_nullObject, self::$_nullObject, 'civicrm_custom');
   }
 
   /**
    * This hook is called when composing the ACL where clause to restrict
    * visibility of contacts to the logged in user
    *
-   * @param int $type the type of permission needed
-   * @param array $tables (reference ) add the tables that are needed for the select clause
-   * @param array $whereTables (reference ) add the tables that are needed for the where clause
-   * @param int    $contactID the contactID for whom the check is made
-   * @param string $where the currrent where clause
+   * @param int $type
+   *   The type of permission needed.
+   * @param array $tables
+   *   (reference ) add the tables that are needed for the select clause.
+   * @param array $whereTables
+   *   (reference ) add the tables that are needed for the where clause.
+   * @param int $contactID
+   *   The contactID for whom the check is made.
+   * @param string $where
+   *   The currrent where clause.
    *
-   * @return null the return value is ignored
+   * @return null
+   *   the return value is ignored
    */
-  static function aclWhereClause($type, &$tables, &$whereTables, &$contactID, &$where) {
-    return self::singleton()->invoke(5, $type, $tables, $whereTables, $contactID, $where, self::$_nullObject, 'civicrm_aclWhereClause');
+  public static function aclWhereClause($type, &$tables, &$whereTables, &$contactID, &$where) {
+    return self::singleton()
+      ->invoke(5, $type, $tables, $whereTables, $contactID, $where, self::$_nullObject, 'civicrm_aclWhereClause');
   }
 
   /**
    * This hook is called when composing the ACL where clause to restrict
    * visibility of contacts to the logged in user
    *
-   * @param int    $type          the type of permission needed
-   * @param int    $contactID     the contactID for whom the check is made
-   * @param string $tableName     the tableName which is being permissioned
-   * @param array  $allGroups     the set of all the objects for the above table
-   * @param array  $currentGroups the set of objects that are currently permissioned for this contact
+   * @param int $type
+   *   The type of permission needed.
+   * @param int $contactID
+   *   The contactID for whom the check is made.
+   * @param string $tableName
+   *   The tableName which is being permissioned.
+   * @param array $allGroups
+   *   The set of all the objects for the above table.
+   * @param array $currentGroups
+   *   The set of objects that are currently permissioned for this contact.
    *
-   * @return null the return value is ignored
+   * @return null
+   *   the return value is ignored
    */
-  static function aclGroup($type, $contactID, $tableName, &$allGroups, &$currentGroups) {
-    return self::singleton()->invoke(5, $type, $contactID, $tableName, $allGroups, $currentGroups, self::$_nullObject, 'civicrm_aclGroup');
+  public static function aclGroup($type, $contactID, $tableName, &$allGroups, &$currentGroups) {
+    return self::singleton()
+      ->invoke(5, $type, $contactID, $tableName, $allGroups, $currentGroups, self::$_nullObject, 'civicrm_aclGroup');
   }
 
   /**
-   * This hook is called when building the menu table
+   * This hook is called when building the menu table.
    *
-   * @param array $files The current set of files to process
+   * @param array $files
+   *   The current set of files to process.
    *
-   * @return null the return value is ignored
+   * @return null
+   *   the return value is ignored
    */
-  static function xmlMenu(&$files) {
+  public static function xmlMenu(&$files) {
     return self::singleton()->invoke(1, $files,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_xmlMenu'
@@ -434,14 +506,26 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * This hook is called for declaring managed entities via API
+   * This hook is called for declaring managed entities via API.
    *
-   * @param array $entities List of pending entities
+   * @param array $entities
+   *   List of pending entities. Each entity is an array with keys:
+   *   + 'module': string; for module-extensions, this is the fully-qualifed name (e.g. "com.example.mymodule"); for CMS modules, the name is prefixed by the CMS (e.g. "drupal.mymodule")
+   *   + 'name': string, a symbolic name which can be used to track this entity (Note: Each module creates its own namespace)
+   *   + 'entity': string, an entity-type supported by the CiviCRM API (Note: this currently must be an entity which supports the 'is_active' property)
+   *   + 'params': array, the entity data as supported by the CiviCRM API
+   *   + 'update' (v4.5+): string, a policy which describes when to update records
+   *     - 'always' (default): always update the managed-entity record; changes in $entities will override any local changes (eg by the site-admin)
+   *     - 'never': never update the managed-entity record; changes made locally (eg by the site-admin) will override changes in $entities
+   *   + 'cleanup' (v4.5+): string, a policy which describes whether to cleanup the record when it becomes orphaned (ie when $entities no longer references the record)
+   *     - 'always' (default): always delete orphaned records
+   *     - 'never': never delete orphaned records
+   *     - 'unused': only delete orphaned records if there are no other references to it in the DB. (This is determined by calling the API's "getrefcount" action.)
    *
-   * @return null the return value is ignored
-   * @access public
+   * @return null
+   *   the return value is ignored
    */
-  static function managed(&$entities) {
+  public static function managed(&$entities) {
     return self::singleton()->invoke(1, $entities,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_managed'
@@ -451,14 +535,16 @@ abstract class CRM_Utils_Hook {
   /**
    * This hook is called when rendering the dashboard (q=civicrm/dashboard)
    *
-   * @param int $contactID - the contactID for whom the dashboard is being rendered
-   * @param int $contentPlacement - (output parameter) where should the hook content be displayed
+   * @param int $contactID
+   *   The contactID for whom the dashboard is being rendered.
+   * @param int $contentPlacement
+   *   (output parameter) where should the hook content be displayed.
    * relative to the activity list
    *
-   * @return string the html snippet to include in the dashboard
-   * @access public
+   * @return string
+   *   the html snippet to include in the dashboard
    */
-  static function dashboard($contactID, &$contentPlacement = self::DASHBOARD_BELOW) {
+  public static function dashboard($contactID, &$contentPlacement = self::DASHBOARD_BELOW) {
     $retval = self::singleton()->invoke(2, $contactID, $contentPlacement,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_dashboard'
@@ -479,12 +565,12 @@ abstract class CRM_Utils_Hook {
   /**
    * This hook is called before storing recently viewed items.
    *
-   * @param array $recentArray - an array of recently viewed or processed items, for in place modification
+   * @param array $recentArray
+   *   An array of recently viewed or processed items, for in place modification.
    *
    * @return array
-   * @access public
    */
-  static function recent(&$recentArray) {
+  public static function recent(&$recentArray) {
     return self::singleton()->invoke(1, $recentArray,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_recent'
@@ -492,16 +578,18 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * Determine how many other records refer to a given record
+   * Determine how many other records refer to a given record.
    *
-   * @param CRM_Core_DAO $dao the item for which we want a reference count
-   * @param array $refCounts each item in the array is an array with keys:
+   * @param CRM_Core_DAO $dao
+   *   The item for which we want a reference count.
+   * @param array $refCounts
+   *   Each item in the array is an Array with keys:
    *   - name: string, eg "sql:civicrm_email:contact_id"
    *   - type: string, eg "sql"
    *   - count: int, eg "5" if there are 5 email addresses that refer to $dao
    * @return void
    */
-  static function referenceCounts($dao, &$refCounts) {
+  public static function referenceCounts($dao, &$refCounts) {
     return self::singleton()->invoke(2, $dao, $refCounts,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_referenceCounts'
@@ -509,16 +597,18 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * This hook is called when building the amount structure for a Contribution or Event Page
+   * This hook is called when building the amount structure for a Contribution or Event Page.
    *
-   * @param int    $pageType - is this a contribution or event page
-   * @param CRM_Core_Form $form     - reference to the form object
-   * @param array  $amount   - the amount structure to be displayed
+   * @param int $pageType
+   *   Is this a contribution or event page.
+   * @param CRM_Core_Form $form
+   *   Reference to the form object.
+   * @param array $amount
+   *   The amount structure to be displayed.
    *
    * @return null
-   * @access public
    */
-  static function buildAmount($pageType, &$form, &$amount) {
+  public static function buildAmount($pageType, &$form, &$amount) {
     return self::singleton()->invoke(3, $pageType, $form, $amount, self::$_nullObject,
       self::$_nullObject, self::$_nullObject, 'civicrm_buildAmount');
   }
@@ -532,7 +622,7 @@ abstract class CRM_Utils_Hook {
    *
    * @return null
    */
-  static function buildStateProvinceForCountry($countryID, &$states) {
+  public static function buildStateProvinceForCountry($countryID, &$states) {
     return self::singleton()->invoke(2, $countryID, $states,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_buildStateProvinceForCountry'
@@ -542,12 +632,14 @@ abstract class CRM_Utils_Hook {
   /**
    * This hook is called when rendering the tabs for a contact (q=civicrm/contact/view)c
    *
-   * @param array $tabs      - the array of tabs that will be displayed
-   * @param int   $contactID - the contactID for whom the dashboard is being rendered
+   * @param array $tabs
+   *   The array of tabs that will be displayed.
+   * @param int $contactID
+   *   The contactID for whom the dashboard is being rendered.
    *
    * @return null
    */
-  static function tabs(&$tabs, $contactID) {
+  public static function tabs(&$tabs, $contactID) {
     return self::singleton()->invoke(2, $tabs, $contactID,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_tabs'
     );
@@ -566,7 +658,7 @@ abstract class CRM_Utils_Hook {
    *
    * @return null
    */
-  static function tabset($tabsetName, &$tabs, $context) {
+  public static function tabset($tabsetName, &$tabs, $context) {
     return self::singleton()->invoke(3, $tabsetName, $tabs,
       $context, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_tabset'
     );
@@ -575,12 +667,12 @@ abstract class CRM_Utils_Hook {
   /**
    * This hook is called when sending an email / printing labels
    *
-   * @param array $tokens    - the list of tokens that can be used for the contact
+   * @param array $tokens
+   *   The list of tokens that can be used for the contact.
    *
    * @return null
-   * @access public
    */
-  static function tokens(&$tokens) {
+  public static function tokens(&$tokens) {
     return self::singleton()->invoke(1, $tokens,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_tokens'
     );
@@ -590,34 +682,40 @@ abstract class CRM_Utils_Hook {
    * This hook is called when sending an email / printing labels to get the values for all the
    * tokens returned by the 'tokens' hook
    *
-   * @param array  $details    - the array to store the token values indexed by contactIDs (unless it a single)
-   * @param array  $contactIDs - an array of contactIDs
-   * @param int    $jobID      - the jobID if this is associated with a CiviMail mailing
-   * @param array  $tokens     - the list of tokens associated with the content
-   * @param string $className  - the top level className from where the hook is invoked
+   * @param array $details
+   *   The array to store the token values indexed by contactIDs (unless it a single).
+   * @param array $contactIDs
+   *   An array of contactIDs.
+   * @param int $jobID
+   *   The jobID if this is associated with a CiviMail mailing.
+   * @param array $tokens
+   *   The list of tokens associated with the content.
+   * @param string $className
+   *   The top level className from where the hook is invoked.
    *
    * @return null
-   * @access public
    */
-  static function tokenValues(&$details,
+  public static function tokenValues(
+    &$details,
     $contactIDs,
-    $jobID     = NULL,
-    $tokens    = array(),
+    $jobID = NULL,
+    $tokens = array(),
     $className = NULL
   ) {
-    return self::singleton()->invoke(5, $details, $contactIDs, $jobID, $tokens, $className, self::$_nullObject, 'civicrm_tokenValues');
+    return self::singleton()
+      ->invoke(5, $details, $contactIDs, $jobID, $tokens, $className, self::$_nullObject, 'civicrm_tokenValues');
   }
 
   /**
    * This hook is called before a CiviCRM Page is rendered. You can use this hook to insert smarty variables
    * in a  template
    *
-   * @param object $page - the page that will be rendered
+   * @param object $page
+   *   The page that will be rendered.
    *
    * @return null
-   * @access public
    */
-  static function pageRun(&$page) {
+  public static function pageRun(&$page) {
     return self::singleton()->invoke(1, $page,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_pageRun'
@@ -628,13 +726,14 @@ abstract class CRM_Utils_Hook {
    * This hook is called after a copy of an object has been made. The current objects are
    * Event, Contribution Page and UFGroup
    *
-   * @param string $objectName - name of the object
-   * @param object $object     - reference to the copy
+   * @param string $objectName
+   *   Name of the object.
+   * @param object $object
+   *   Reference to the copy.
    *
    * @return null
-   * @access public
    */
-  static function copy($objectName, &$object) {
+  public static function copy($objectName, &$object) {
     return self::singleton()->invoke(2, $objectName, $object,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_copy'
@@ -659,27 +758,32 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function unsubscribeGroups($op, $mailingId, $contactId, &$groups, &$baseGroups) {
-    return self::singleton()->invoke(5, $op, $mailingId, $contactId, $groups, $baseGroups, self::$_nullObject, 'civicrm_unsubscribeGroups');
+  public static function unsubscribeGroups($op, $mailingId, $contactId, &$groups, &$baseGroups) {
+    return self::singleton()
+      ->invoke(5, $op, $mailingId, $contactId, $groups, $baseGroups, self::$_nullObject, 'civicrm_unsubscribeGroups');
   }
 
   /**
    * This hook is called when CiviCRM needs to edit/display a custom field with options (select, radio, checkbox,
    * adv multiselect)
    *
-   * @param int $customFieldID - the custom field ID
-   * @param array $options - the current set of options for that custom field.
+   * @param int $customFieldID
+   *   The custom field ID.
+   * @param array $options
+   *   The current set of options for that custom field.
    *   You can add/remove existing options.
    *   Important: This array may contain meta-data about the field that is needed elsewhere, so it is important
    *              to be careful to not overwrite the array.
    *   Only add/edit/remove the specific field options you intend to affect.
-   * @param boolean $detailedFormat - if true,
+   * @param bool $detailedFormat
+   *   If true,.
    *                the options are in an ID => array ( 'id' => ID, 'label' => label, 'value' => value ) format
-   * @param array $selectAttributes contain select attribute(s) if any
+   * @param array $selectAttributes
+   *   Contain select attribute(s) if any.
    *
    * @return mixed
    */
-  static function customFieldOptions($customFieldID, &$options, $detailedFormat = FALSE, $selectAttributes = array()) {
+  public static function customFieldOptions($customFieldID, &$options, $detailedFormat = FALSE, $selectAttributes = array()) {
     return self::singleton()->invoke(3, $customFieldID, $options, $detailedFormat,
       self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_customFieldOptions'
@@ -691,9 +795,11 @@ abstract class CRM_Utils_Hook {
    * This hook is called to display the list of actions allowed after doing a search.
    * This allows the module developer to inject additional actions or to remove existing actions.
    *
-   * @param string $objectType - the object type for this search
+   * @param string $objectType
+   *   The object type for this search.
    *   - activity, campaign, case, contact, contribution, event, grant, membership, and pledge are supported.
-   * @param array $tasks - the current set of tasks for that custom field.
+   * @param array $tasks
+   *   The current set of tasks for that custom field.
    *   You can add/remove existing tasks.
    *   Each task needs to have a title (eg 'title'  => ts( 'Add Contacts to Group')) and a class
    *   (eg 'class'  => 'CRM_Contact_Form_Task_AddToGroup').
@@ -703,7 +809,7 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function searchTasks($objectType, &$tasks) {
+  public static function searchTasks($objectType, &$tasks) {
     return self::singleton()->invoke(2, $objectType, $tasks,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_searchTasks'
@@ -716,7 +822,7 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function eventDiscount(&$form, &$params) {
+  public static function eventDiscount(&$form, &$params) {
     return self::singleton()->invoke(2, $form, $params,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_eventDiscount'
@@ -735,7 +841,7 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function mailingGroups(&$form, &$groups, &$mailings) {
+  public static function mailingGroups(&$form, &$groups, &$mailings) {
     return self::singleton()->invoke(3, $form, $groups, $mailings,
       self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_mailingGroups'
@@ -756,7 +862,7 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function membershipTypeValues(&$form, &$membershipTypes) {
+  public static function membershipTypeValues(&$form, &$membershipTypes) {
     return self::singleton()->invoke(2, $form, $membershipTypes,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_membershipTypeValues'
@@ -764,7 +870,7 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * This hook is called when rendering the contact summary
+   * This hook is called when rendering the contact summary.
    *
    * @param int $contactID
    *   The contactID for whom the summary is being rendered
@@ -776,7 +882,7 @@ abstract class CRM_Utils_Hook {
    * @return string
    *   The html snippet to include in the contact summary
    */
-  static function summary($contactID, &$content, &$contentPlacement = self::SUMMARY_BELOW) {
+  public static function summary($contactID, &$content, &$contentPlacement = self::SUMMARY_BELOW) {
     return self::singleton()->invoke(3, $contactID, $content, $contentPlacement,
       self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_summary'
@@ -790,20 +896,24 @@ abstract class CRM_Utils_Hook {
    * - you can override that behavior by providing a SQL query that returns some subset of your contacts.
    * The hook is called when the query is executed to get the list of contacts to display.
    *
-   * @param mixed $query - - the query that will be executed (input and output parameter);
+   * @param mixed $query
+   *   - the query that will be executed (input and output parameter);.
    *   It's important to realize that the ACL clause is built prior to this hook being fired,
    *   so your query will ignore any ACL rules that may be defined.
    *   Your query must return two columns:
    *     the contact 'data' to display in the autocomplete dropdown (usually contact.sort_name - aliased as 'data')
    *     the contact IDs
-   * @param string $name - the name string to execute the query against (this is the value being typed in by the user)
-   * @param string $context - the context in which this ajax call is being made (for example: 'customfield', 'caseview')
-   * @param int $id - the id of the object for which the call is being made.
+   * @param string $name
+   *   The name string to execute the query against (this is the value being typed in by the user).
+   * @param string $context
+   *   The context in which this ajax call is being made (for example: 'customfield', 'caseview').
+   * @param int $id
+   *   The id of the object for which the call is being made.
    *   For custom fields, it will be the custom field id
    *
    * @return mixed
    */
-  static function contactListQuery(&$query, $name, $context, $id) {
+  public static function contactListQuery(&$query, $name, $context, $id) {
     return self::singleton()->invoke(4, $query, $name, $context, $id,
       self::$_nullObject, self::$_nullObject,
       'civicrm_contactListQuery'
@@ -827,7 +937,8 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function alterPaymentProcessorParams($paymentObj,
+  public static function alterPaymentProcessorParams(
+    $paymentObj,
     &$rawParams,
     &$cookedParams
   ) {
@@ -842,12 +953,13 @@ abstract class CRM_Utils_Hook {
    *
    * @param array $params
    *   Array fields include: groupName, from, toName, toEmail, subject, cc, bcc, text, html,
-   * returnPath, replyTo, headers, attachments (array)
-   * @param string $context - the context in which the hook is being invoked, eg 'civimail'
+   *   returnPath, replyTo, headers, attachments (array)
+   * @param string $context
+   *   The context in which the hook is being invoked, eg 'civimail'.
    *
    * @return mixed
    */
-  static function alterMailParams(&$params, $context = NULL) {
+  public static function alterMailParams(&$params, $context = NULL) {
     return self::singleton()->invoke(2, $params, $context,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_alterMailParams'
@@ -855,21 +967,24 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * This hook is called when membership status is being calculated
+   * This hook is called when membership status is being calculated.
    *
-   * @param array $membershipStatus membership status details as determined - alter if required
-   * @param array $arguments arguments passed in to calculate date
+   * @param array $membershipStatus
+   *   Membership status details as determined - alter if required.
+   * @param array $arguments
+   *   Arguments passed in to calculate date.
    * - 'start_date'
    * - 'end_date'
    * - 'status_date'
    * - 'join_date'
    * - 'exclude_is_admin'
    * - 'membership_type_id'
-   * @param array $membership membership details from the calling function
+   * @param array $membership
+   *   Membership details from the calling function.
    *
    * @return mixed
    */
-  static function alterCalculatedMembershipStatus(&$membershipStatus, $arguments, $membership) {
+  public static function alterCalculatedMembershipStatus(&$membershipStatus, $arguments, $membership) {
     return self::singleton()->invoke(3, $membershipStatus, $arguments,
       $membership, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_alterCalculatedMembershipStatus'
@@ -877,15 +992,16 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * This hook is called when rendering the Manage Case screen
+   * This hook is called when rendering the Manage Case screen.
    *
-   * @param int $caseID - the case ID
+   * @param int $caseID
+   *   The case ID.
    *
-   * @return array of data to be displayed, where the key is a unique id to be used for styling (div id's)
-   * and the value is an array with keys 'label' and 'value' specifying label/value pairs
-   * @access public
+   * @return array
+   *   Array of data to be displayed, where the key is a unique id to be used for styling (div id's)
+   *   and the value is an array with keys 'label' and 'value' specifying label/value pairs
    */
-  static function caseSummary($caseID) {
+  public static function caseSummary($caseID) {
     return self::singleton()->invoke(1, $caseID,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_caseSummary'
@@ -899,8 +1015,9 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function caseTypes(&$caseTypes) {
-    return self::singleton()->invoke(1, $caseTypes, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_caseTypes');
+  public static function caseTypes(&$caseTypes) {
+    return self::singleton()
+      ->invoke(1, $caseTypes, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_caseTypes');
   }
 
   /**
@@ -912,7 +1029,7 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function config(&$config) {
+  public static function config(&$config) {
     return self::singleton()->invoke(1, $config,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_config'
@@ -920,21 +1037,7 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * @param $recordBAO
-   * @param int $recordID
-   * @param $isActive
-   *
-   * @return mixed
-   */
-  static function enableDisable($recordBAO, $recordID, $isActive) {
-    return self::singleton()->invoke(3, $recordBAO, $recordID, $isActive,
-      self::$_nullObject, self::$_nullObject, self::$_nullObject,
-      'civicrm_enableDisable'
-    );
-  }
-
-  /**
-   * This hooks allows to change option values
+   * This hooks allows to change option values.
    *
    * @param array $options
    *   Associated array of option values / id
@@ -943,7 +1046,7 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function optionValues(&$options, $name) {
+  public static function optionValues(&$options, $name) {
     return self::singleton()->invoke(2, $options, $name,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_optionValues'
@@ -958,7 +1061,7 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function navigationMenu(&$params) {
+  public static function navigationMenu(&$params) {
     return self::singleton()->invoke(1, $params,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_navigationMenu'
@@ -968,15 +1071,20 @@ abstract class CRM_Utils_Hook {
   /**
    * This hook allows modification of the data used to perform merging of duplicates.
    *
-   * @param string $type the type of data being passed (cidRefs|eidRefs|relTables|sqls)
-   * @param array $data the data, as described in $type
-   * @param int $mainId contact_id of the contact that survives the merge
-   * @param int $otherId contact_id of the contact that will be absorbed and deleted
-   * @param array $tables when $type is "sqls", an array of tables as it may have been handed to the calling function
+   * @param string $type
+   *   The type of data being passed (cidRefs|eidRefs|relTables|sqls).
+   * @param array $data
+   *   The data, as described in $type.
+   * @param int $mainId
+   *   Contact_id of the contact that survives the merge.
+   * @param int $otherId
+   *   Contact_id of the contact that will be absorbed and deleted.
+   * @param array $tables
+   *   When $type is "sqls", an array of tables as it may have been handed to the calling function.
    *
    * @return mixed
    */
-  static function merge($type, &$data, $mainId = NULL, $otherId = NULL, $tables = NULL) {
+  public static function merge($type, &$data, $mainId = NULL, $otherId = NULL, $tables = NULL) {
     return self::singleton()->invoke(5, $type, $data, $mainId, $otherId, $tables, self::$_nullObject, 'civicrm_merge');
   }
 
@@ -988,7 +1096,7 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function notePrivacy(&$noteValues) {
+  public static function notePrivacy(&$noteValues) {
     return self::singleton()->invoke(1, $noteValues,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_notePrivacy'
@@ -996,16 +1104,20 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * This hook is called before record is exported as CSV
+   * This hook is called before record is exported as CSV.
    *
-   * @param string $exportTempTable - name of the temporary export table used during export
-   * @param array  $headerRows      - header rows for output
-   * @param array  $sqlColumns      - SQL columns
-   * @param int    $exportMode      - export mode ( contact, contribution, etc...)
+   * @param string $exportTempTable
+   *   Name of the temporary export table used during export.
+   * @param array $headerRows
+   *   Header rows for output.
+   * @param array $sqlColumns
+   *   SQL columns.
+   * @param int $exportMode
+   *   Export mode ( contact, contribution, etc...).
    *
    * @return mixed
    */
-  static function export(&$exportTempTable, &$headerRows, &$sqlColumns, &$exportMode) {
+  public static function export(&$exportTempTable, &$headerRows, &$sqlColumns, &$exportMode) {
     return self::singleton()->invoke(4, $exportTempTable, $headerRows, $sqlColumns, $exportMode,
       self::$_nullObject, self::$_nullObject,
       'civicrm_export'
@@ -1015,14 +1127,16 @@ abstract class CRM_Utils_Hook {
   /**
    * This hook allows modification of the queries constructed from dupe rules.
    *
-   * @param string $obj object of rulegroup class
-   * @param string $type type of queries e.g table / threshold
-   * @param array $query set of queries
+   * @param string $obj
+   *   Object of rulegroup class.
+   * @param string $type
+   *   Type of queries e.g table / threshold.
+   * @param array $query
+   *   Set of queries.
    *
    * @return mixed
-   * @access public
    */
-  static function dupeQuery($obj, $type, &$query) {
+  public static function dupeQuery($obj, $type, &$query) {
     return self::singleton()->invoke(3, $obj, $type, $query,
       self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_dupeQuery'
@@ -1032,28 +1146,35 @@ abstract class CRM_Utils_Hook {
   /**
    * This hook is called AFTER EACH email has been processed by the script bin/EmailProcessor.php
    *
-   * @param string $type type of mail processed: 'activity' OR 'mailing'
+   * @param string $type
+   *   Type of mail processed: 'activity' OR 'mailing'.
    * @param array &$params the params that were sent to the CiviCRM API function
-   * @param object $mail the mail object which is an ezcMail class
+   * @param object $mail
+   *   The mail object which is an ezcMail class.
    * @param array &$result the result returned by the api call
-   * @param string $action (optional ) the requested action to be performed if the types was 'mailing'
+   * @param string $action
+   *   (optional ) the requested action to be performed if the types was 'mailing'.
    *
    * @return mixed
-   * @access public
    */
-  static function emailProcessor($type, &$params, $mail, &$result, $action = NULL) {
-    return self::singleton()->invoke(5, $type, $params, $mail, $result, $action, self::$_nullObject, 'civicrm_emailProcessor');
+  public static function emailProcessor($type, &$params, $mail, &$result, $action = NULL) {
+    return self::singleton()
+      ->invoke(5, $type, $params, $mail, $result, $action, self::$_nullObject, 'civicrm_emailProcessor');
   }
 
   /**
    * This hook is called after a row has been processed and the
    * record (and associated records imported
    *
-   * @param string  $object     - object being imported (for now Contact only, later Contribution, Activity,
+   * @param string $object
+   *   Object being imported (for now Contact only, later Contribution, Activity,.
    *                               Participant and Member)
-   * @param string  $usage      - hook usage/location (for now process only, later mapping and others)
-   * @param string  $objectRef  - import record object
-   * @param array   $params     - array with various key values: currently
+   * @param string $usage
+   *   Hook usage/location (for now process only, later mapping and others).
+   * @param string $objectRef
+   *   Import record object.
+   * @param array $params
+   *   Array with various key values: currently.
    *                  contactID       - contact id
    *                  importID        - row id in temp table
    *                  importTempTable - name of tempTable
@@ -1061,9 +1182,8 @@ abstract class CRM_Utils_Hook {
    *                  fields          - import fields
    *
    * @return void
-   * @access public
    */
-  static function import($object, $usage, &$objectRef, &$params) {
+  public static function import($object, $usage, &$objectRef, &$params) {
     return self::singleton()->invoke(4, $object, $usage, $objectRef, $params,
       self::$_nullObject, self::$_nullObject,
       'civicrm_import'
@@ -1074,14 +1194,16 @@ abstract class CRM_Utils_Hook {
    * This hook is called when API permissions are checked (cf. civicrm_api3_api_check_permission()
    * in api/v3/utils.php and _civicrm_api3_permissions() in CRM/Core/DAO/permissions.php).
    *
-   * @param string $entity the API entity (like contact)
-   * @param string $action the API action (like get)
+   * @param string $entity
+   *   The API entity (like contact).
+   * @param string $action
+   *   The API action (like get).
    * @param array &$params the API parameters
    * @param array &$permissions the associative permissions array (probably to be altered by this hook)
    *
    * @return mixed
    */
-  static function alterAPIPermissions($entity, $action, &$params, &$permissions) {
+  public static function alterAPIPermissions($entity, $action, &$params, &$permissions) {
     return self::singleton()->invoke(4, $entity, $action, $params, $permissions,
       self::$_nullObject, self::$_nullObject,
       'civicrm_alterAPIPermissions'
@@ -1093,7 +1215,7 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function postSave(&$dao) {
+  public static function postSave(&$dao) {
     $hookName = 'civicrm_postSave_' . $dao->getTableName();
     return self::singleton()->invoke(1, $dao,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
@@ -1104,12 +1226,14 @@ abstract class CRM_Utils_Hook {
   /**
    * This hook allows user to customize context menu Actions on contact summary page.
    *
-   * @param array $actions Array of all Actions in contextmenu.
-   * @param int $contactID ContactID for the summary page
+   * @param array $actions
+   *   Array of all Actions in contextmenu.
+   * @param int $contactID
+   *   ContactID for the summary page.
    *
    * @return mixed
    */
-  static function summaryActions(&$actions, $contactID = NULL) {
+  public static function summaryActions(&$actions, $contactID = NULL) {
     return self::singleton()->invoke(2, $actions, $contactID,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_summaryActions'
@@ -1126,17 +1250,18 @@ abstract class CRM_Utils_Hook {
    * However, if you use the same number of columns, you can overwrite the existing columns with the values that
    * you want displayed. This is a hackish, but avoids template modification.
    *
-   * @param string $objectName the component name that we are doing the search
+   * @param string $objectName
+   *   The component name that we are doing the search.
    *                           activity, campaign, case, contact, contribution, event, grant, membership, and pledge
    * @param array &$headers the list of column headers, an associative array with keys: ( name, sort, order )
    * @param array &$rows the list of values, an associate array with fields that are displayed for that component
-   * @param $selector
+   * @param array $selector
+   *   the selector object. Allows you access to the context of the search
    *
-   * @internal param array $seletor the selector object. Allows you access to the context of the search
-   *
-   * @return void  modify the header and values object to pass the data u need
+   * @return void
+   *   modify the header and values object to pass the data u need
    */
-  static function searchColumns($objectName, &$headers, &$rows, &$selector) {
+  public static function searchColumns($objectName, &$headers, &$rows, &$selector) {
     return self::singleton()->invoke(4, $objectName, $headers, $rows, $selector,
       self::$_nullObject, self::$_nullObject,
       'civicrm_searchColumns'
@@ -1146,13 +1271,14 @@ abstract class CRM_Utils_Hook {
   /**
    * This hook is called when uf groups are being built for a module.
    *
-   * @param string $moduleName module name.
-   * @param array $ufGroups array of ufgroups for a module.
+   * @param string $moduleName
+   *   Module name.
+   * @param array $ufGroups
+   *   Array of ufgroups for a module.
    *
    * @return null
-   * @access public
    */
-  static function buildUFGroupsForModule($moduleName, &$ufGroups) {
+  public static function buildUFGroupsForModule($moduleName, &$ufGroups) {
     return self::singleton()->invoke(2, $moduleName, $ufGroups,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_buildUFGroupsForModule'
@@ -1163,9 +1289,12 @@ abstract class CRM_Utils_Hook {
    * This hook is called when we are determining the contactID for a specific
    * email address
    *
-   * @param string $email     the email address
-   * @param int    $contactID the contactID that matches this email address, IF it exists
-   * @param array  $result (reference) has two fields
+   * @param string $email
+   *   The email address.
+   * @param int $contactID
+   *   The contactID that matches this email address, IF it exists.
+   * @param array $result
+   *   (reference) has two fields.
    *                          contactID - the new (or same) contactID
    *                          action - 3 possible values:
    *                          CRM_Utils_Mail_Incoming::EMAILPROCESSOR_CREATE_INDIVIDUAL - create a new contact record
@@ -1173,9 +1302,8 @@ abstract class CRM_Utils_Hook {
    *                          CRM_Utils_Mail_Incoming::EMAILPROCESSOR_IGNORE   - skip this email address
    *
    * @return null
-   * @access public
    */
-  static function emailProcessorContact($email, $contactID, &$result) {
+  public static function emailProcessorContact($email, $contactID, &$result) {
     return self::singleton()->invoke(3, $email, $contactID, $result,
       self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_emailProcessorContact'
@@ -1183,9 +1311,10 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * Hook definition for altering the generation of Mailing Labels
+   * Hook definition for altering the generation of Mailing Labels.
    *
-   * @param array $args an array of the args in the order defined for the tcpdf multiCell api call
+   * @param array $args
+   *   An array of the args in the order defined for the tcpdf multiCell api call.
    *                    with the variable names below converted into string keys (ie $w become 'w'
    *                    as the first key for $args)
    *   float $w Width of cells. If 0, they extend up to the right margin of the page.
@@ -1214,7 +1343,7 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function alterMailingLabelParams(&$args) {
+  public static function alterMailingLabelParams(&$args) {
     return self::singleton()->invoke(1, $args,
       self::$_nullObject, self::$_nullObject,
       self::$_nullObject, self::$_nullObject, self::$_nullObject,
@@ -1223,17 +1352,20 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * This hooks allows alteration of generated page content
+   * This hooks allows alteration of generated page content.
    *
-   * @param $content  previously generated content
-   * @param $context  context of content - page or form
-   * @param $tplName  the file name of the tpl
-   * @param $object   a reference to the page or form object
+   * @param $content
+   *   Previously generated content.
+   * @param $context
+   *   Context of content - page or form.
+   * @param $tplName
+   *   The file name of the tpl.
+   * @param $object
+   *   A reference to the page or form object.
    *
    * @return mixed
-   * @access public
    */
-  static function alterContent(&$content, $context, $tplName, &$object) {
+  public static function alterContent(&$content, $context, $tplName, &$object) {
     return self::singleton()->invoke(4, $content, $context, $tplName, $object,
       self::$_nullObject, self::$_nullObject,
       'civicrm_alterContent'
@@ -1244,15 +1376,18 @@ abstract class CRM_Utils_Hook {
    * This hooks allows alteration of the tpl file used to generate content. It differs from the
    * altercontent hook as the content has already been rendered through the tpl at that point
    *
-   * @param $formName  previously generated content
-   * @param $form reference to the form object
-   * @param $context  context of content - page or form
-   * @param $tplName reference the file name of the tpl
+   * @param $formName
+   *   Previously generated content.
+   * @param $form
+   *   Reference to the form object.
+   * @param $context
+   *   Context of content - page or form.
+   * @param $tplName
+   *   Reference the file name of the tpl.
    *
    * @return mixed
-   * @access public
    */
-  static function alterTemplateFile($formName, &$form, $context, &$tplName) {
+  public static function alterTemplateFile($formName, &$form, $context, &$tplName) {
     return self::singleton()->invoke(4, $formName, $form, $context, $tplName,
       self::$_nullObject, self::$_nullObject,
       'civicrm_alterTemplateFile'
@@ -1260,10 +1395,11 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * This hook collects the trigger definition from all components
+   * This hook collects the trigger definition from all components.
    *
    * @param $info
-   * @param string $tableName (optional) the name of the table that we are interested in only
+   * @param string $tableName
+   *   (optional) the name of the table that we are interested in only.
    *
    * @internal param \reference $triggerInfo to an array of trigger information
    *   each element has 4 fields:
@@ -1276,7 +1412,7 @@ abstract class CRM_Utils_Hook {
    *             templatizing logging and other hooks
    * @return mixed
    */
-  static function triggerInfo(&$info, $tableName = NULL) {
+  public static function triggerInfo(&$info, $tableName = NULL) {
     return self::singleton()->invoke(2, $info, $tableName,
       self::$_nullObject, self::$_nullObject, self::$_nullObject,
       self::$_nullObject,
@@ -1289,7 +1425,7 @@ abstract class CRM_Utils_Hook {
    * Each module will receive hook_civicrm_install during its own installation (but not during the
    * installation of unrelated modules).
    */
-  static function install() {
+  public static function install() {
     return self::singleton()->invoke(0, self::$_nullObject,
       self::$_nullObject, self::$_nullObject,
       self::$_nullObject, self::$_nullObject, self::$_nullObject,
@@ -1302,7 +1438,7 @@ abstract class CRM_Utils_Hook {
    * Each module will receive hook_civicrm_uninstall during its own uninstallation (but not during the
    * uninstallation of unrelated modules).
    */
-  static function uninstall() {
+  public static function uninstall() {
     return self::singleton()->invoke(0, self::$_nullObject,
       self::$_nullObject, self::$_nullObject,
       self::$_nullObject, self::$_nullObject, self::$_nullObject,
@@ -1315,7 +1451,7 @@ abstract class CRM_Utils_Hook {
    * Each module will receive hook_civicrm_enable during its own re-enablement (but not during the
    * re-enablement of unrelated modules).
    */
-  static function enable() {
+  public static function enable() {
     return self::singleton()->invoke(0, self::$_nullObject,
       self::$_nullObject, self::$_nullObject,
       self::$_nullObject, self::$_nullObject, self::$_nullObject,
@@ -1328,7 +1464,7 @@ abstract class CRM_Utils_Hook {
    * Each module will receive hook_civicrm_disable during its own disablement (but not during the
    * disablement of unrelated modules).
    */
-  static function disable() {
+  public static function disable() {
     return self::singleton()->invoke(0, self::$_nullObject,
       self::$_nullObject, self::$_nullObject,
       self::$_nullObject, self::$_nullObject, self::$_nullObject,
@@ -1343,7 +1479,7 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function alterReportVar($varType, &$var, &$object) {
+  public static function alterReportVar($varType, &$var, &$object) {
     return self::singleton()->invoke(3, $varType, $var, $object,
       self::$_nullObject,
       self::$_nullObject, self::$_nullObject,
@@ -1364,7 +1500,7 @@ abstract class CRM_Utils_Hook {
    *   TRUE, if $op is 'check' and upgrades are pending.
    *   FALSE, if $op is 'check' and upgrades are not pending.
    */
-  static function upgrade($op, CRM_Queue_Queue $queue = NULL) {
+  public static function upgrade($op, CRM_Queue_Queue $queue = NULL) {
     return self::singleton()->invoke(2, $op, $queue,
       self::$_nullObject, self::$_nullObject, self::$_nullObject,
       self::$_nullObject,
@@ -1382,7 +1518,7 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function postEmailSend(&$params) {
+  public static function postEmailSend(&$params) {
     return self::singleton()->invoke(1, $params,
       self::$_nullObject, self::$_nullObject,
       self::$_nullObject, self::$_nullObject, self::$_nullObject,
@@ -1391,18 +1527,18 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * This hook is called when Settings specifications are loaded
+   * This hook is called when Settings specifications are loaded.
    *
    * @param array $settingsFolders
    *   List of paths from which to derive metadata
    *
    * @return mixed
    */
-  static function alterSettingsFolders(&$settingsFolders) {
+  public static function alterSettingsFolders(&$settingsFolders) {
     return self::singleton()->invoke(1, $settingsFolders,
-        self::$_nullObject, self::$_nullObject,
-        self::$_nullObject, self::$_nullObject, self::$_nullObject,
-        'civicrm_alterSettingsFolders'
+      self::$_nullObject, self::$_nullObject,
+      self::$_nullObject, self::$_nullObject, self::$_nullObject,
+      'civicrm_alterSettingsFolders'
     );
   }
 
@@ -1410,17 +1546,18 @@ abstract class CRM_Utils_Hook {
    * This hook is called when Settings have been loaded from the xml
    * It is an opportunity for hooks to alter the data
    *
-   * @param array $settingsMetaData - Settings Metadata
+   * @param array $settingsMetaData
+   *   Settings Metadata.
    * @param int $domainID
    * @param mixed $profile
    *
    * @return mixed
    */
-  static function alterSettingsMetaData(&$settingsMetaData, $domainID, $profile) {
+  public static function alterSettingsMetaData(&$settingsMetaData, $domainID, $profile) {
     return self::singleton()->invoke(3, $settingsMetaData,
-        $domainID, $profile,
-        self::$_nullObject, self::$_nullObject, self::$_nullObject,
-        'civicrm_alterSettingsMetaData'
+      $domainID, $profile,
+      self::$_nullObject, self::$_nullObject, self::$_nullObject,
+      'civicrm_alterSettingsMetaData'
     );
   }
 
@@ -1434,11 +1571,11 @@ abstract class CRM_Utils_Hook {
    * @return null
    *   The return value is ignored
    */
-  static function apiWrappers(&$wrappers, $apiRequest) {
+  public static function apiWrappers(&$wrappers, $apiRequest) {
     return self::singleton()
       ->invoke(2, $wrappers, $apiRequest, self::$_nullObject, self::$_nullObject, self::$_nullObject,
-      self::$_nullObject, 'civicrm_apiWrappers'
-    );
+        self::$_nullObject, 'civicrm_apiWrappers'
+      );
   }
 
   /**
@@ -1449,7 +1586,7 @@ abstract class CRM_Utils_Hook {
    * @return null
    *   The return value is ignored.
    */
-  static function cron($jobManager) {
+  public static function cron($jobManager) {
     return self::singleton()->invoke(1,
       $jobManager, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_cron'
@@ -1467,16 +1604,33 @@ abstract class CRM_Utils_Hook {
    * @return null
    *   The return value is ignored
    */
-  static function permission(&$permissions) {
+  public static function permission(&$permissions) {
     return self::singleton()->invoke(1, $permissions,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_permission'
     );
   }
 
+  /**
+   * @param CRM_Core_Exception Exception $exception
+   * @param mixed $request
+   *   Reserved for future use.
+   */
+  public static function unhandledException($exception, $request = NULL) {
+    self::singleton()
+      ->invoke(2, $exception, $request, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_unhandled_exception');
+    // == 4.4 ==
+    //$event = new stdClass();
+    //$event->exception = $exception;
+    //CRM_Core_LegacyErrorHandler::handleException($event);
+
+    // == 4.5+ ==
+    $event = new \Civi\Core\Event\UnhandledExceptionEvent($exception, self::$_nullObject);
+    \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_unhandled_exception", $event);
+  }
 
   /**
-   * This hook is called for declaring managed entities via API
+   * This hook is called for declaring managed entities via API.
    *
    * @param array[] $entityTypes
    *   List of entity types; each entity-type is an array with keys:
@@ -1487,41 +1641,41 @@ abstract class CRM_Utils_Hook {
    * @return null
    *   The return value is ignored
    */
-  static function entityTypes(&$entityTypes) {
+  public static function entityTypes(&$entityTypes) {
     return self::singleton()->invoke(1, $entityTypes, self::$_nullObject, self::$_nullObject,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_entityTypes'
     );
   }
 
   /**
-   * This hook is called while preparing a profile form
+   * This hook is called while preparing a profile form.
    *
    * @param string $name
    * @return mixed
    */
-  static function buildProfile($name) {
+  public static function buildProfile($name) {
     return self::singleton()->invoke(1, $name, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       self::$_nullObject, self::$_nullObject, 'civicrm_buildProfile');
   }
 
   /**
-   * This hook is called while validating a profile form submission
+   * This hook is called while validating a profile form submission.
    *
    * @param string $name
    * @return mixed
    */
-  static function validateProfile($name) {
+  public static function validateProfile($name) {
     return self::singleton()->invoke(1, $name, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       self::$_nullObject, self::$_nullObject, 'civicrm_validateProfile');
   }
 
   /**
-   * This hook is called processing a valid profile form submission
+   * This hook is called processing a valid profile form submission.
    *
    * @param string $name
    * @return mixed
    */
-  static function processProfile($name) {
+  public static function processProfile($name) {
     return self::singleton()->invoke(1, $name, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       self::$_nullObject, self::$_nullObject, 'civicrm_processProfile');
   }
@@ -1532,7 +1686,7 @@ abstract class CRM_Utils_Hook {
    * @param string $name
    * @return mixed
    */
-  static function viewProfile($name) {
+  public static function viewProfile($name) {
     return self::singleton()->invoke(1, $name, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       self::$_nullObject, self::$_nullObject, 'civicrm_viewProfile');
   }
@@ -1543,7 +1697,7 @@ abstract class CRM_Utils_Hook {
    * @param string $name
    * @return mixed
    */
-  static function searchProfile($name) {
+  public static function searchProfile($name) {
     return self::singleton()->invoke(1, $name, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       self::$_nullObject, self::$_nullObject, 'civicrm_searchProfile');
   }
@@ -1551,28 +1705,37 @@ abstract class CRM_Utils_Hook {
   /**
    * This hook is invoked when building a CiviCRM name badge.
    *
-   * @param string $labelName string referencing name of badge format
-   * @param object $label    reference to the label object
-   * @param array  $format   array of format data
-   * @param array  $participant array of participant values
+   * @param string $labelName
+   *   String referencing name of badge format.
+   * @param object $label
+   *   Reference to the label object.
+   * @param array $format
+   *   Array of format data.
+   * @param array $participant
+   *   Array of participant values.
    *
-   * @return null the return value is ignored
+   * @return null
+   *   the return value is ignored
    */
-  static function alterBadge($labelName, &$label, &$format, &$participant) {
-    return self::singleton()->invoke(4, $labelName, $label, $format, $participant, self::$_nullObject, self::$_nullObject, 'civicrm_alterBadge');
+  public static function alterBadge($labelName, &$label, &$format, &$participant) {
+    return self::singleton()
+      ->invoke(4, $labelName, $label, $format, $participant, self::$_nullObject, self::$_nullObject, 'civicrm_alterBadge');
   }
 
 
   /**
-   * This hook is called before encoding data in barcode
+   * This hook is called before encoding data in barcode.
    *
-   * @param array  $data associated array of values available for encoding
-   * @param string $type type of barcode, classic barcode or QRcode
-   * @param string $context where this hooks is invoked.
+   * @param array $data
+   *   Associated array of values available for encoding.
+   * @param string $type
+   *   Type of barcode, classic barcode or QRcode.
+   * @param string $context
+   *   Where this hooks is invoked.
    *
    * @return mixed
    */
-  static function alterBarcode( &$data, $type = 'barcode', $context = 'name_badge' ) {
+  public static function alterBarcode(&$data, $type = 'barcode', $context = 'name_badge') {
     return self::singleton()->invoke(3, $data, $type, $context, self::$_nullObject,
       self::$_nullObject, self::$_nullObject, 'civicrm_alterBarcode');
   }
@@ -1590,7 +1753,7 @@ abstract class CRM_Utils_Hook {
    * @return mixed
    * @see Mail::factory
    */
-  static function alterMail(&$mailer, $driver, $params) {
+  public static function alterMail(&$mailer, $driver, $params) {
     return self::singleton()
       ->invoke(3, $mailer, $driver, $params, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_alterMailer');
   }
@@ -1604,12 +1767,13 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function queryObjects(&$queryObjects, $type = 'Contact') {
-    return self::singleton()->invoke(2, $queryObjects, $type, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_queryObjects');
+  public static function queryObjects(&$queryObjects, $type = 'Contact') {
+    return self::singleton()
+      ->invoke(2, $queryObjects, $type, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_queryObjects');
   }
 
   /**
-   * This hook is called while viewing contact dashboard
+   * This hook is called while viewing contact dashboard.
    *
    * @param array $availableDashlets
    *   List of dashlets; each is formatted per api/v3/Dashboard
@@ -1618,38 +1782,41 @@ abstract class CRM_Utils_Hook {
    *
    * @return mixed
    */
-  static function dashboard_defaults($availableDashlets, &$defaultDashlets) {
-    return self::singleton()->invoke(2, $availableDashlets, $defaultDashlets, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_dashboard_defaults');
+  public static function dashboard_defaults($availableDashlets, &$defaultDashlets) {
+    return self::singleton()
+      ->invoke(2, $availableDashlets, $defaultDashlets, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_dashboard_defaults');
   }
 
   /**
    * This hook is called before a case merge (or a case reassign)
    *
-   * @param integer $mainContactId
-   * @param integer $mainCaseId
-   * @param integer $otherContactId
-   * @param integer $otherCaseId
+   * @param int $mainContactId
+   * @param int $mainCaseId
+   * @param int $otherContactId
+   * @param int $otherCaseId
    * @param bool $changeClient
    *
    * @return void
    */
-  static function pre_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) {
-    return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, self::$_nullObject, 'civicrm_pre_case_merge');
+  public static function pre_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) {
+    return self::singleton()
+      ->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, self::$_nullObject, 'civicrm_pre_case_merge');
   }
 
   /**
    * This hook is called after a case merge (or a case reassign)
    *
-   * @param integer $mainContactId
-   * @param integer $mainCaseId
-   * @param integer $otherContactId
-   * @param integer $otherCaseId
+   * @param int $mainContactId
+   * @param int $mainCaseId
+   * @param int $otherContactId
+   * @param int $otherCaseId
    * @param bool $changeClient
    *
    * @return void
    */
-  static function post_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) {
-    return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, self::$_nullObject, 'civicrm_post_case_merge');
+  public static function post_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) {
+    return self::singleton()
+      ->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, self::$_nullObject, 'civicrm_post_case_merge');
   }
 
   /**
@@ -1660,11 +1827,12 @@ abstract class CRM_Utils_Hook {
    *
    * @param string $displayName
    * @param int $contactId
-   * @param object $dao the contact object
+   * @param object $dao
+   *   The contact object.
    *
    * @return mixed
    */
-  static function alterDisplayName($displayName, $contactId, $dao) {
+  public static function alterDisplayName($displayName, $contactId, $dao) {
     return self::singleton()->invoke(3,
       $displayName, $contactId, $dao, self::$_nullObject, self::$_nullObject,
       self::$_nullObject, 'civicrm_contact_get_displayname'
@@ -1674,18 +1842,27 @@ abstract class CRM_Utils_Hook {
   /**
    * EXPERIMENTAL: This hook allows one to register additional Angular modules
    *
-   * @param array $angularModules list of modules
-   * @return null the return value is ignored
-   * @access public
+   * @param array $angularModules
+   *   List of modules.
+   * @return null
+   *   the return value is ignored
    *
    * @code
    * function mymod_civicrm_angularModules(&$angularModules) {
-   *   $angularModules['myAngularModule'] = array('ext' => 'org.example.mymod', 'js' => array('js/myAngularModule.js'));
-   *   $angularModules['myBigAngularModule'] = array('ext' => 'org.example.mymod', 'js' => array('js/part1.js', 'js/part2.js'), 'css' => array('css/myAngularModule.css'));
+   *   $angularModules['myAngularModule'] = array(
+   *     'ext' => 'org.example.mymod',
+   *     'js' => array('js/myAngularModule.js'),
+   *   );
+   *   $angularModules['myBigAngularModule'] = array(
+   *     'ext' => 'org.example.mymod',
+   *     'js' => array('js/part1.js', 'js/part2.js'),
+   *     'css' => array('css/myAngularModule.css'),
+   *     'partials' => array('partials/myBigAngularModule'),
+   *   );
    * }
    * @endcode
    */
-  static function angularModules(&$angularModules) {
+  public static function angularModules(&$angularModules) {
     return self::singleton()->invoke(1, $angularModules,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_angularModules'
@@ -1697,7 +1874,7 @@ abstract class CRM_Utils_Hook {
    *
    * @param \Civi\CCase\Analyzer $analyzer
    */
-  static function caseChange(\Civi\CCase\Analyzer $analyzer) {
+  public static function caseChange(\Civi\CCase\Analyzer $analyzer) {
     $event = new \Civi\CCase\Event\CaseChangeEvent($analyzer);
     \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_caseChange", $event);
 
@@ -1708,22 +1885,24 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * Generate a default CRUD URL for an entity
+   * Generate a default CRUD URL for an entity.
    *
-   * @param array $spec with keys:
+   * @param array $spec
+   *   With keys:.
    *   - action: int, eg CRM_Core_Action::VIEW or CRM_Core_Action::UPDATE
    *   - entity_table: string
    *   - entity_id: int
    * @param CRM_Core_DAO $bao
-   * @param array $link to define the link, add these keys to $link:
-   *  - title: string
-   *  - path: string
-   *  - query: array
-   *  - url: string (used in lieu of "path"/"query")
+   * @param array $link
+   *   To define the link, add these keys to $link:.
+   *   - title: string
+   *   - path: string
+   *   - query: array
+   *   - url: string (used in lieu of "path"/"query")
    *      Note: if making "url" CRM_Utils_System::url(), set $htmlize=false
    * @return mixed
    */
-  static function crudLink($spec, $bao, &$link) {
+  public static function crudLink($spec, $bao, &$link) {
     return self::singleton()->invoke(3, $spec, $bao, $link,
       self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_crudLink'
@@ -1731,13 +1910,14 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * @param array<CRM_Core_FileSearchInterface> $fileSearches
+   * @param array <CRM_Core_FileSearchInterface> $fileSearches
    * @return mixed
    */
-  static function fileSearches(&$fileSearches) {
+  public static function fileSearches(&$fileSearches) {
     return self::singleton()->invoke(1, $fileSearches,
       self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
       'civicrm_fileSearches'
     );
   }
+
 }