INFRA-132 - CRM/Core - phpcbf
[civicrm-core.git] / CRM / Core / Payment / Realex.php
index a9b63b33c4c9d2e2d2d96b3df07c79911887927b..c1901c60019ab84823cbba7d85e221d3e8fd47f7 100644 (file)
@@ -89,7 +89,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
    * @return object
    * @static
    */
-  public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = false) {
+  public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
     if (!empty($paymentProcessor['id'])) {
       $cacheKey = $paymentProcessor['id'];
     }
@@ -172,7 +172,6 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
     $hashme   = "$sha1hash.{$this->_getParam('secret')}";
     $sha1hash = sha1($hashme);
 
-
     // Generate the request xml that is send to Realex Payments.
     $request_xml = "<request type='auth' timestamp='{$this->_getParam('timestamp')}'>
           <merchantid>{$this->_getParam('merchant_ref')}</merchantid>
@@ -361,7 +360,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
    *  Format the params from the form ready for sending to Realex.  Also perform some validation
    */
   public function setRealexFields(&$params) {
-    if ((int)$params['amount'] <= 0) {
+    if ((int) $params['amount'] <= 0) {
       return self::error(9001, ts('Amount must be positive'));
     }
 
@@ -432,17 +431,17 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
     $this->_setParam('currency', $config->defaultCurrency);
 
     // Format the expiry date to MMYY
-    $expmonth = (string)$params['month'];
+    $expmonth = (string) $params['month'];
     $expmonth = (strlen($expmonth) === 1) ? '0' . $expmonth : $expmonth;
-    $expyear  = substr((string)$params['year'], 2, 2);
+    $expyear  = substr((string) $params['year'], 2, 2);
     $this->_setParam('exp_date', $expmonth . $expyear);
 
     if (isset($params['credit_card_start_date']) && (strlen($params['credit_card_start_date']['M']) !== 0) &&
       (strlen($params['credit_card_start_date']['Y']) !== 0)
     ) {
-      $startmonth = (string)$params['credit_card_start_date']['M'];
+      $startmonth = (string) $params['credit_card_start_date']['M'];
       $startmonth = (strlen($startmonth) === 1) ? '0' . $startmonth : $startmonth;
-      $startyear  = substr((string)$params['credit_card_start_date']['Y'], 2, 2);
+      $startyear  = substr((string) $params['credit_card_start_date']['Y'], 2, 2);
       $this->_setParam('start_date', $startmonth . $startyear);
     }