INFRA-132 - Fix spacing of @return tag in comments
[civicrm-core.git] / CRM / Financial / Form / FinancialAccount.php
index c848a4e913f6502a27761f577ed1364992167a78..e60ac153c32bb92e9fb981caa7681b9f52caa073 100644 (file)
@@ -51,7 +51,6 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form {
    * Set variables up before form is built
    *
    * @return void
-   * @access public
    */
   public function preProcess() {
     parent::preProcess();
@@ -78,10 +77,9 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form {
    * Build the form object
    *
    * @return void
-   * @access public
    */
-  public function buildQuickForm( ) {
-    parent::buildQuickForm( );
+  public function buildQuickForm() {
+    parent::buildQuickForm();
     $this->setPageTitle(ts('Financial Account'));
 
     if ($this->_action & CRM_Core_Action::DELETE) {
@@ -136,22 +134,22 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form {
    *
    * @internal param array $fields posted values of the form
    *
-   * @return array list of errors to be posted back to the form
+   * @return array
+   *   list of errors to be posted back to the form
    * @static
-   * @access public
    */
-  static function formRule( $values, $files, $self ) {
-    $errorMsg = array( );
+  public static function formRule($values, $files, $self) {
+    $errorMsg = array();
     $financialAccountTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('financial_account_type', NULL, " AND v.name LIKE 'Liability' "));
     if (isset($values['is_tax'])) {
-      if ($values['financial_account_type_id'] !=  $financialAccountTypeId) {
+      if ($values['financial_account_type_id'] != $financialAccountTypeId) {
         $errorMsg['financial_account_type_id'] = ts('Taxable accounts should have Financial Account Type set to Liability.');
       }
       if (CRM_Utils_Array::value('tax_rate', $values) == NULL) {
         $errorMsg['tax_rate'] = ts('Please enter value for tax rate');
       }
     }
-    if ((CRM_Utils_Array::value('tax_rate', $values) != NULL))  {
+    if ((CRM_Utils_Array::value('tax_rate', $values) != NULL)) {
       if ($values['tax_rate'] < 0 || $values['tax_rate'] >= 100) {
         $errorMsg['tax_rate'] = ts('Tax Rate Should be between 0 - 100');
       }
@@ -161,7 +159,7 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form {
         $relationshipId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Sales Tax Account is' "));
         $params = array(
           'financial_account_id'  => $self->_id,
-          'account_relationship'=> $relationshipId
+          'account_relationship' => $relationshipId,
         );
         $result = CRM_Financial_BAO_FinancialTypeAccount::retrieve($params, $defaults);
         if ($result) {
@@ -169,18 +167,17 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form {
         }
       }
     }
-    return CRM_Utils_Array::crmIsEmptyArray( $errorMsg ) ? true : $errorMsg;
+    return CRM_Utils_Array::crmIsEmptyArray($errorMsg) ? TRUE : $errorMsg;
   }
 
   /**
    * Set default values for the form.
    * the default values are retrieved from the database
    *
-   * @access public
    *
    * @return void
    */
-  function setDefaultValues() {
+  public function setDefaultValues() {
     $defaults = parent::setDefaultValues();
     if ($this->_action & CRM_Core_Action::ADD) {
       $defaults['contact_id'] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', CRM_Core_Config::domainID(), 'contact_id');
@@ -191,16 +188,15 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form {
   /**
    * Process the form submission
    *
-   * @access public
    * @return void
    */
   public function postProcess() {
     if ($this->_action & CRM_Core_Action::DELETE) {
       CRM_Financial_BAO_FinancialAccount::del($this->_id);
-      CRM_Core_Session::setStatus( ts('Selected Financial Account has been deleted.') );
+      CRM_Core_Session::setStatus(ts('Selected Financial Account has been deleted.'));
     }
     else {
-      $ids = array( );
+      $ids = array();
       // store the submitted values in an array
       $params = $this->exportValues();