Merge pull request #4959 from rohankatkar/batch-17
[civicrm-core.git] / CRM / Custom / Form / Option.php
index 2b8df559266b220dfafa0e852176e89b319346af..e91b96e535d4207e0c12ab3e21011d737b37cdf7 100644 (file)
@@ -67,8 +67,6 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
   /**
    * Set variables up before form is built
    *
-   * @param null
-   *
    * @return void
    */
   public function preProcess() {
@@ -103,9 +101,8 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
    * Set default values for the form. Note that in edit/view mode
    * the default values are retrieved from the database
    *
-   * @param null
-   *
-   * @return array   array of default values
+   * @return array
+   *   array of default values
    */
   public function setDefaultValues() {
     $defaults = $fieldDefaults = array();
@@ -150,8 +147,6 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
   /**
    * Build the form object
    *
-   * @param null
-   *
    * @return void
    */
   public function buildQuickForm() {
@@ -218,7 +213,6 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
         )
       );
 
-
       // if view mode pls freeze it with the done button.
       if ($this->_action & CRM_Core_Action::VIEW) {
         $this->freeze();
@@ -239,18 +233,19 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
   /**
    * Global validation rules for the form
    *
-   * @param array $fields posted values of the form
+   * @param array $fields
+   *   Posted values of the form.
    *
    * @param $files
    * @param CRM_Core_Form $form
    *
-   * @return array list of errors to be posted back to the form
-   * @static
+   * @return array
+   *   list of errors to be posted back to the form
    */
   public static function formRule($fields, $files, $form) {
-    $optionLabel   = $fields['label'];
-    $optionValue   = $fields['value'];
-    $fieldId       = $form->_fid;
+    $optionLabel = $fields['label'];
+    $optionValue = $fields['value'];
+    $fieldId = $form->_fid;
     $optionGroupId = $form->_optionGroupID;
 
     $temp = array();
@@ -391,8 +386,6 @@ SELECT count(*)
   /**
    * Process the form
    *
-   * @param null
-   *
    * @return void
    */
   public function postProcess() {
@@ -424,8 +417,8 @@ SELECT count(*)
     }
 
     $fieldValues = array('option_group_id' => $this->_optionGroupID);
-    $customOption->weight =
-      CRM_Utils_Weight::updateOtherWeights(
+    $customOption->weight
+      CRM_Utils_Weight::updateOtherWeights(
         'CRM_Core_DAO_OptionValue',
         $oldWeight,
         $params['weight'],
@@ -455,8 +448,8 @@ SELECT count(*)
           else {
             $defVal[] = $customOption->value;
           }
-          $customField->default_value =
-            CRM_Core_DAO::VALUE_SEPARATOR .
+          $customField->default_value
+            CRM_Core_DAO::VALUE_SEPARATOR .
             implode(CRM_Core_DAO::VALUE_SEPARATOR, $defVal) .
             CRM_Core_DAO::VALUE_SEPARATOR;
           $customField->save();
@@ -470,8 +463,8 @@ SELECT count(*)
           }
         }
 
-        $customField->default_value =
-          CRM_Core_DAO::VALUE_SEPARATOR .
+        $customField->default_value
+          CRM_Core_DAO::VALUE_SEPARATOR .
           implode(CRM_Core_DAO::VALUE_SEPARATOR, $tempVal) .
           CRM_Core_DAO::VALUE_SEPARATOR;
         $customField->save();
@@ -520,4 +513,3 @@ SELECT count(*)
     }
   }
 }
-