Merge pull request #5077 from eileenmcnaughton/comment-full-stops
[civicrm-core.git] / CRM / Admin / Form / Extensions.php
index 1c614b7cdef769a3ec2a9c55771f189458dc5c8f..1d55aeb9ac3da5bc6b261164739452476682b5a5 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        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -57,7 +57,6 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form {
     $this->assign('id', $this->_id);
     $this->assign('key', $this->_key);
 
-
     switch ($this->_action) {
       case CRM_Core_Action::ADD:
       case CRM_Core_Action::DELETE:
@@ -69,7 +68,7 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form {
         break;
 
       case CRM_Core_Action::UPDATE:
-        if (! CRM_Extension_System::singleton()->getBrowser()->isEnabled()) {
+        if (!CRM_Extension_System::singleton()->getBrowser()->isEnabled()) {
           CRM_Core_Error::fatal(ts('The system administrator has disabled this feature.'));
         }
         $info = CRM_Extension_System::singleton()->getBrowser()->getExtension($this->_key);
@@ -109,12 +108,12 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form {
     switch ($this->_action) {
       case CRM_Core_Action::ADD:
         $buttonName = ts('Install');
-        $title = ts('Install ' . $extName  . '?');
+        $title = ts('Install ' . $extName . '?');
         break;
 
       case CRM_Core_Action::UPDATE:
         $buttonName = ts('Download and Install');
-        $title = ts('Download and Install ' . $extName  . '?');
+        $title = ts('Download and Install ' . $extName . '?');
         break;
 
       case CRM_Core_Action::DELETE:
@@ -151,12 +150,15 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form {
   /**
    * Global form rule
    *
-   * @param array $fields  the input form values
-   * @param array $files   the uploaded files if any
-   * @param array $self    this object.
+   * @param array $fields
+   *   The input form values.
+   * @param array $files
+   *   The uploaded files if any.
+   * @param array $self
+   *   This object.
    *
-   * @return true if no errors, else an array of errors
-   * @static
+   * @return bool|array
+   *   true if no errors, else an array of errors
    */
   public static function formRule($fields, $files, $self) {
     $errors = array();
@@ -177,7 +179,8 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form {
       try {
         CRM_Extension_System::singleton()->getManager()->uninstall(array($this->_key));
         CRM_Core_Session::setStatus("", ts('Extension Uninstalled'), "success");
-      } catch (CRM_Extension_Exception_DependencyException $e) {
+      }
+      catch (CRM_Extension_Exception_DependencyException $e) {
         // currently only thrown for payment-processor dependencies
         CRM_Core_Session::setStatus(ts('Cannot uninstall this extension - there is at least one payment processor using the payment processor type provided by it.'), ts('Uninstall Error'), 'error');
       }
@@ -203,9 +206,10 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form {
         'version' => 3,
         'key' => $this->_key,
       ));
-      if (! CRM_Utils_Array::value('is_error', $result, FALSE)) {
+      if (!CRM_Utils_Array::value('is_error', $result, FALSE)) {
         CRM_Core_Session::setStatus("", ts('Extension Upgraded'), "success");
-      } else {
+      }
+      else {
         CRM_Core_Session::setStatus($result['error_message'], ts('Extension Upgrade Failed'), "error");
       }
     }
@@ -217,4 +221,5 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form {
       )
     );
   }
+
 }