Api docblock cleanup.
[civicrm-core.git] / api / v3 / System.php
index 6dcf12b9de7c6b0c21f182c44cddb512ad75498d..661e0caf340577e12f4fec501bfd8fe53a54f46a 100644 (file)
@@ -1,8 +1,7 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  */
 
 /**
- * File for the CiviCRM APIv3 domain functions
- *
- * @package CiviCRM_APIv3
- * @subpackage API_Domain
+ * This api exposes CiviCRM system functionality.
  *
- * @copyright CiviCRM LLC (c) 2004-2014
- * @version $Id: Domain.php 30171 2010-10-14 09:11:27Z mover $
+ * Includes caching, logging, and checking system functionality.
  *
+ * @package CiviCRM_APIv3
  */
 
 /**
- * Flush all system caches
- *
- * @param  array       $params input parameters
- *                          - triggers: bool, whether to drop/create SQL triggers; default: FALSE
- *                          - session:  bool, whether to reset the CiviCRM session data; defaul: FALSE
+ * Flush all system caches.
  *
- * @return boolean        true if success, else false
- * @static void
- * @access public
- * @example SystemFlush.php
+ * @param array $params
+ *   Input parameters.
+ *   - triggers: bool, whether to drop/create SQL triggers; default: FALSE
+ *   - session:  bool, whether to reset the CiviCRM session data; default: FALSE
  *
+ * @return array
  */
 function civicrm_api3_system_flush($params) {
   CRM_Core_Invoke::rebuildMenuAndCaches(
@@ -59,22 +52,26 @@ function civicrm_api3_system_flush($params) {
 }
 
 /**
- * Adjust Metadata for Flush action
+ * Adjust Metadata for Flush action.
+ *
+ * The metadata is used for setting defaults, documentation & validation.
  *
- * The metadata is used for setting defaults, documentation & validation
- * @param array $params array or parameters determined by getfields
+ * @param array $params
+ *   Array of parameters determined by getfields.
  */
-function _civicrm_api3_system_flush_spec(&$params){
+function _civicrm_api3_system_flush_spec(&$params) {
   $params['triggers'] = array('title' => 'rebuild triggers (boolean)');
   $params['session'] = array('title' => 'refresh sessions (boolean)');
 }
 
 /**
- * System.Check API specification (optional)
+ * System.Check API specification (optional).
+ *
  * This is used for documentation and validation.
  *
- * @param array $spec description of fields supported by this API call
- * @return void
+ * @param array $spec
+ *   Description of fields supported by this API call.
+ *
  * @see http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
  */
 function _civicrm_api3_system_check_spec(&$spec) {
@@ -82,10 +79,12 @@ function _civicrm_api3_system_check_spec(&$spec) {
 }
 
 /**
- * System.Check API
+ * System Check API.
  *
  * @param array $params
- * @return array API result descriptor; return items are alert codes/messages
+ *
+ * @return array
+ *   API result descriptor; return items are alert codes/messages
  * @see civicrm_api3_create_success
  * @see civicrm_api3_create_error
  * @throws API_Exception
@@ -101,20 +100,22 @@ function civicrm_api3_system_check($params) {
 }
 
 /**
- * @param $params
+ * Log entry to system log table.
+ *
+ * @param array $params
  *
  * @return array
  */
 function civicrm_api3_system_log($params) {
   $log = new CRM_Utils_SystemLogger();
-  // this part means fields with separate db storage are accepted as params which kind of seems more intuitive to me
+  // This part means fields with separate db storage are accepted as params which kind of seems more intuitive to me
   // because I felt like not doing this required a bunch of explanation in the spec function - but perhaps other won't see it as helpful?
-  if(!isset($params['context'])) {
+  if (!isset($params['context'])) {
     $params['context'] = array();
   }
   $specialFields = array('contact_id', 'hostname');
-  foreach($specialFields as $specialField) {
-    if(isset($params[$specialField]) && !isset($params['context'])) {
+  foreach ($specialFields as $specialField) {
+    if (isset($params[$specialField]) && !isset($params['context'])) {
       $params['context'][$specialField] = $params[$specialField];
     }
   }
@@ -123,8 +124,9 @@ function civicrm_api3_system_log($params) {
 }
 
 /**
- * Metadata for log function
- * @param $params
+ * Metadata for log function.
+ *
+ * @param array $params
  */
 function _civicrm_api3_system_log_spec(&$params) {
   $params['level'] = array(
@@ -158,9 +160,11 @@ function _civicrm_api3_system_log_spec(&$params) {
 }
 
 /**
- * System.Get API
+ * System.Get API.
+ *
+ * @param array $params
  *
- * @param arary $params
+ * @return array
  */
 function civicrm_api3_system_get($params) {
   $returnValues = array(
@@ -171,4 +175,3 @@ function civicrm_api3_system_get($params) {
   );
   return civicrm_api3_create_success($returnValues, $params, 'System', 'get');
 }
-