Common.js lint fixes
[civicrm-core.git] / Civi / Payment / System.php
index f72aaab48d7a73662946480ad1449de66adb630f..29538b64bf7d95cf75d80186c5d33048faa09229 100644 (file)
@@ -30,7 +30,7 @@ class System {
 
   /**
    * @param array $processor
-   * @throws \Civi\Payment\CRM_Core_Exception
+   * @throws \CRM_Core_Exception
    */
   public function getByProcessor($processor) {
     $id = $processor['id'];
@@ -47,7 +47,7 @@ class System {
         else {
           $paymentClass = 'CRM_Core_' . $processor['class_name'];
           if (empty($paymentClass)) {
-            throw new CRM_Core_Exception('no class provided');
+            throw new \CRM_Core_Exception('no class provided');
           }
           require_once str_replace('_', DIRECTORY_SEPARATOR, $paymentClass) . '.php';
         }
@@ -59,7 +59,7 @@ class System {
   }
 
   /**
-   * @param integer $id
+   * @param int $id
    * @throws \CiviCRM_API3_Exception
    */
   public function getById($id) {
@@ -76,4 +76,15 @@ class System {
     $processor = civicrm_api3('payment_processor', 'get_single', array('name' => $name, 'is_test' => $is_test));
     return self::getByProcessor($processor);
   }
+
+  /**
+   * Flush processors from static cache.
+   *
+   * This is particularly used for tests.
+   *
+   */
+  public function flushProcessors() {
+    $this->cache = array();
+  }
+
 }