INFRA-132 - Put space after flow-control (if/switch/for/foreach/while)
[civicrm-core.git] / CRM / Grant / BAO / Grant.php
index 1c9aff8e756827e7a0dfe3bc1e2299ea818ae733..7873796c1804a214343c8592bb4c4d62f81793e9 100644 (file)
@@ -44,7 +44,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
   /**
    * Class constructor
    */
-  function __construct() {
+  public function __construct() {
     parent::__construct();
   }
 
@@ -57,7 +57,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
    *
    * @return array Array of event summary values
    */
-  static function getGrantSummary($admin = FALSE) {
+  public static function getGrantSummary($admin = FALSE) {
     $query = "
             SELECT status_id, count(id) as status_total
             FROM civicrm_grant  GROUP BY status_id";
@@ -95,7 +95,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
    *
    * @return array Array of event summary values
    */
-  static function getGrantStatusOptGroup() {
+  public static function getGrantStatusOptGroup() {
 
     $params = array();
     $params['name'] = CRM_Grant_BAO_Grant::$statusGroupName;
@@ -119,21 +119,22 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
    *
    * @return array Array of grant summary statistics
    */
-  static function getGrantStatistics($admin = FALSE) {
+  public static function getGrantStatistics($admin = FALSE) {
     $grantStatuses = array();
   }
 
   /**
    * Fetch object based on array of properties
    *
-   * @param array $params   (reference ) an assoc array of name/value pairs
-   * @param array $defaults (reference ) an assoc array to hold the flattened values
+   * @param array $params
+   *   (reference ) an assoc array of name/value pairs.
+   * @param array $defaults
+   *   (reference ) an assoc array to hold the flattened values.
    *
    * @return CRM_Grant_BAO_ManageGrant object
-   * @access public
    * @static
    */
-  static function retrieve(&$params, &$defaults) {
+  public static function retrieve(&$params, &$defaults) {
     $grant = new CRM_Grant_DAO_Grant();
     $grant->copyValues($params);
     if ($grant->find(TRUE)) {
@@ -146,15 +147,16 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
   /**
    * Add grant
    *
-   * @param array $params reference array contains the values submitted by the form
-   * @param array $ids    reference array contains the id
+   * @param array $params
+   *   Reference array contains the values submitted by the form.
+   * @param array $ids
+   *   Reference array contains the id.
    *
-   * @access public
    * @static
    *
    * @return object
    */
-  static function add(&$params, &$ids) {
+  public static function add(&$params, &$ids) {
 
     if (!empty($ids['grant_id'])) {
       CRM_Utils_Hook::pre('edit', 'Grant', $ids['grant_id'], $params);
@@ -206,7 +208,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
 
     $grantTypes = CRM_Core_PseudoConstant::get('CRM_Grant_DAO_Grant', 'grant_type_id');
     if (empty($params['skipRecentView'])) {
-      if(!isset($grant->contact_id) || !isset($grant->grant_type_id)){
+      if (!isset($grant->contact_id) || !isset($grant->grant_type_id)){
         $grant->find(TRUE);
       }
       $title = CRM_Contact_BAO_Contact::displayName($grant->contact_id) . ' - ' . ts('Grant') . ': ' . $grantTypes[$grant->grant_type_id];
@@ -223,7 +225,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
         );
       }
 
-    // add the recently created Grant
+      // add the recently created Grant
       CRM_Utils_Recent::add($title,
         $url,
         $grant->id,
@@ -247,11 +249,12 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
   /**
    * Create the event
    *
-   * @param array $params reference array contains the values submitted by the form
-   * @param array $ids reference array contains the id
+   * @param array $params
+   *   Reference array contains the values submitted by the form.
+   * @param array $ids
+   *   Reference array contains the id.
    *
    * @return object
-   * @access public
    * @static
    *
    */
@@ -310,14 +313,14 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
   /**
    * Delete the Contact
    *
-   * @param int $id contact id
+   * @param int $id
+   *   Contact id.
    *
    * @return bool
    *
-   * @access public
    * @static
    */
-  static function deleteContact($id) {
+  public static function deleteContact($id) {
     $grant = new CRM_Grant_DAO_Grant();
     $grant->contact_id = $id;
     $grant->delete();
@@ -327,14 +330,14 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
   /**
    * Delete the grant
    *
-   * @param int $id grant id
+   * @param int $id
+   *   Grant id.
    *
    * @return bool|mixed
-   * @access public
    * @static
    *
    */
-  static function del($id) {
+  public static function del($id) {
     CRM_Utils_Hook::pre('delete', 'Grant', $id, CRM_Core_DAO::$_nullArray);
 
     $grant = new CRM_Grant_DAO_Grant();
@@ -361,10 +364,9 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
    * Combine all the exportable fields from the lower levels object
    *
    * @return array array of exportable Fields
-   * @access public
    * @static
    */
-  static function &exportableFields() {
+  public static function &exportableFields() {
     if (!self::$_exportableFields) {
       if (!self::$_exportableFields) {
         self::$_exportableFields = array();
@@ -399,7 +401,9 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
       );
 
       $fields = CRM_Grant_DAO_Grant::export();
-      $grantNote = array('grant_note' => array('title' => ts('Grant Note'),
+      $grantNote = array(
+      'grant_note' => array(
+      'title' => ts('Grant Note'),
           'name' => 'grant_note',
           'data_type' => CRM_Utils_Type::T_TEXT,
         ));
@@ -418,12 +422,10 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
    * @param int $contactID
    *
    * @return int count of grant records
-   * @access public
    * @static
    */
-  static function getContactGrantCount($contactID) {
+  public static function getContactGrantCount($contactID) {
     $query = "SELECT count(*) FROM civicrm_grant WHERE civicrm_grant.contact_id = {$contactID} ";
     return CRM_Core_DAO::singleValueQuery($query);
   }
 }
-