Permalink
Browse files

Cleaning things up for the code sniffer.

  • Loading branch information...
1 parent d36bbe5 commit 4a80215ee5b9a498e2ecdf4584b686d475b65f4c @LouisLandry committed with Dec 26, 2011
@@ -18,24 +18,123 @@
*/
class JCommerceAddress
{
+ /**
+ * @var string
+ * @since 12.1
+ */
public $title;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $firstName;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $middleName;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $lastName;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $companyName;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $poBox;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $streetNumber;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $streetName;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $streetUnit;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $city;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $region;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $district;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $postalCode;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $country;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $email;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $phone;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $phone2;
+
+ /**
+ * @var string
+ * @since 12.1
+ */
public $timeZone;
+
+ /**
+ * @var float
+ * @since 12.1
+ */
public $longitude;
+
+ /**
+ * @var float
+ * @since 12.1
+ */
public $latitude;
-}
+}
@@ -18,29 +18,75 @@
*/
class JCommerceCart
{
+ /**
+ * @var array
+ * @since 12.1
+ */
public $items = array();
- // Order currency code.
+
+ /**
+ * @var string Order currency code.
+ * @since 12.1
+ */
public $currency = 'USD';
- // Order subtotal.
+
+ /**
+ * @var float Order subtotal.
+ * @since 12.1
+ */
public $subtotal = 0.0;
- // Order shipping total.
+
+ /**
+ * @var float Order shipping total.
+ * @since 12.1
+ */
public $shippingTotal = 0.0;
- // Order handling total.
+
+ /**
+ * @var float Order handling total.
+ * @since 12.1
+ */
public $handlingTotal = 0.0;
- // Order duty total.
+
+ /**
+ * @var float Order duty total.
+ * @since 12.1
+ */
public $dutyTotal = 0.0;
- // Order tax total.
+
+ /**
+ * @var float Order tax total.
+ * @since 12.1
+ */
public $taxTotal = 0.0;
- // Order total.
+
+ /**
+ * @var float Order total.
+ * @since 12.1
+ */
public $total = 0.0;
- // Number of store credits applied to the order.
+
+ /**
+ * @var integer Number of store credits applied to the order.
+ * @since 12.1
+ */
public $storeCredits = 0;
- // Store credit total applied to the order.
+
+ /**
+ * @var float Store credit total applied to the order.
+ * @since 12.1
+ */
public $storeCredit = 0.0;
- // List of applied promotional codes.
+
+ /**
+ * @var array List of applied promotional codes.
+ * @since 12.1
+ */
public $promotionalCodes = array();
- // Single promotional code applied to the order.
- public $promotionalCode;
- // Total amount of discount from promotional code(s).
+
+ /**
+ * @var string Total amount of discount from promotional code(s).
+ * @since 12.1
+ */
public $promotionalDiscount = 0.0;
-}
+}
@@ -93,8 +93,8 @@ class JCommerceOrder
/**
* Constructor
*
- * @param JCommerceCart $cart
- * @param JCommerceOrderState $state
+ * @param JCommerceCart $cart The shopping cart for the order.
+ * @param JCommerceOrderState $state The current order state object.
*
* @since 12.1
*/
@@ -110,7 +110,9 @@ public function __construct(JCommerceCart $cart, JCommerceOrderState $state = nu
}
/**
- * @param JPayment $payment
+ * Method to add a payment object for processing the payment.
+ *
+ * @param JPayment $payment The payment object.
*
* @return JCommerceOrder
*
@@ -160,7 +162,9 @@ public function getShippingAddress()
}
/**
- * @param JPayment $payment
+ * The object to use for payment.
+ *
+ * @param JPayment $payment The payment object.
*
* @return JCommerceOrder
*
@@ -174,7 +178,9 @@ public function removePaymentMethod(JPayment $payment)
}
/**
- * @param JCommerceAddress $address
+ * Set the address to use for billing.
+ *
+ * @param JCommerceAddress $address The address object.
*
* @return JCommerceOrder
*
@@ -188,7 +194,9 @@ public function setBillingAddress(JCommerceAddress $address)
}
/**
- * @param JCommerceAddress $address
+ * Set the address to use for shipping.
+ *
+ * @param JCommerceAddress $address The address object.
*
* @return JCommerceOrder
*
@@ -107,7 +107,8 @@ public function process()
try
{
$this->order->validateCard();
- } catch (Exception $e)
+ }
+ catch (Exception $e)
{
throw new Exception($e->getMessage(), $e->getCode(), $e);
}
@@ -107,7 +107,8 @@ public function process()
try
{
$this->order->validateCard();
- } catch (Exception $e)
+ }
+ catch (Exception $e)
{
throw new Exception($e->getMessage(), $e->getCode(), $e);
}
@@ -155,7 +156,7 @@ protected function buildRequest()
'CREDITCARDTYPE' => $this->order->get('payment.card_type'),
'ACCT' => $this->order->get('payment.card_number'),
'EXPDATE' => $this->order->get('payment.card_exp_month') .
- $this->order->get('payment.card_exp_year'),
+ $this->order->get('payment.card_exp_year'),
'CVV2' => $this->order->get('payment.csc'),
'FIRSTNAME' => $this->order->get('billing.first_name'),
'LASTNAME' => $this->order->get('billing.last_name'),
@@ -256,7 +256,8 @@ public function process()
try
{
$this->order->validateCard();
- } catch (Exception $e)
+ }
+ catch (Exception $e)
{
throw new Exception($e->getMessage(), $e->getCode(), $e);
}
@@ -359,6 +360,9 @@ protected function buildPurchaserRequest($token)
/**
* Method to build setup request payload for PayPal Express as key => value pairs.
*
+ * @param string $returnUrl The successful return URL.
+ * @param string $cancelUrl The URL to use if the purchase was cancelled.
+ *
* @return array
*
* @since 12.1
@@ -151,8 +151,6 @@ class JCommercePaymentResponse
*
* @param array $raw The raw gateway response as key => value pairs.
*
- * @return void
- *
* @since 12.1
*/
public function __construct(array $raw = array())

0 comments on commit 4a80215

Please sign in to comment.