diff --git a/commerce_discount_extra.module b/commerce_discount_extra.module
index a1c6dfb..de4519d 100644
--- a/commerce_discount_extra.module
+++ b/commerce_discount_extra.module
@@ -5,7 +5,7 @@
  * Provides necessary inline conditions and support for extra discounts
  */
 
-/*
+/**
  * Implements hook_inline_conditions_info().
  */
 function commerce_discount_extra_inline_conditions_info() {
@@ -95,18 +95,37 @@ function commerce_discount_extra_inline_conditions_info() {
 
 
 /**
- * Inline condition build callback: compare line item product type
+ * Inline condition build callback: compare line item product type.
+ *
+ * @param EntityDrupalWrapper $line_item_wrapper
+ *   The wrapped entity given by the rule.
+ * @param array $product_types
+ *   Array of product types.
+ *
+ * @return bool
  */
-function commerce_discount_extra_line_item_has_product_type_build($line_item_wrapper, $product_types) {
-  if (in_array($line_item_wrapper->type->value(), commerce_product_line_item_types()) && in_array($line_item_wrapper->commerce_product->type->value(), $product_types)) {
+function commerce_discount_extra_line_item_has_product_type_build(EntityDrupalWrapper $line_item_wrapper, $product_types) {
+  if (in_array($line_item_wrapper->getBundle(), commerce_product_line_item_types()) && in_array($line_item_wrapper->commerce_product->getBundle(), $product_types)) {
     return TRUE;
   }
+
+  return FALSE;
 }
 
 /**
- * Inline condition build callback: compare order total for line items
+ * Inline condition build callback: compare order total for line items.
+ *
+ * @param EntityDrupalWrapper $line_item_wrapper
+ *   The wrapped entity given by the rule.
+ * @param string $operator
+ *   The comparison operator.
+ * @param array $total
+ *   A commerce_price type array.
+ *
+ * @return bool
+ *   return true if condition is valid. false otherwise.
  */
-function commerce_discount_extra_line_item_compare_order_amount_build($line_item_wrapper, $operator, $total) {
+function commerce_discount_extra_line_item_compare_order_amount_build(EntityDrupalWrapper $line_item_wrapper, $operator, $total) {
   module_load_include('inc', 'commerce_discount', 'commerce_discount.rules');
 
   if ($line_item_wrapper->order->value() && $line_item_wrapper->order->order_id->value()) {
@@ -121,6 +140,8 @@ function commerce_discount_extra_line_item_compare_order_amount_build($line_item
       return commerce_order_compare_order_amount_build($order_wrapper, $operator, $total);
     }
   }
+
+  return FALSE;
 }
 
 /**
@@ -128,11 +149,14 @@ function commerce_discount_extra_line_item_compare_order_amount_build($line_item
  * a line item, either by reference or by user's current cart, contains all of a
  * list of skus.
  *
- * @param type $line_item_wrapper
- * @param type $skus
- * @return type
+ * @param EntityDrupalWrapper $line_item_wrapper
+ *   The wrapped entity given by the rule.
+ * @param array $skus
+ *   Array of product SKUs given by the rule.
+ *
+ * @return bool
  */
-function commerce_discount_extra_line_item_order_contains_products_build($line_item_wrapper, $skus) {
+function commerce_discount_extra_line_item_order_contains_products_build(EntityDrupalWrapper $line_item_wrapper, $skus) {
   $products_sku = explode(', ', (string) $skus);
 
   // If the line item has an order, run the "order has products" logic with that
@@ -152,7 +176,7 @@ function commerce_discount_extra_line_item_order_contains_products_build($line_i
   }
 
   if (isset($order_wrapper)) {
-    // Compare discount product ids with thoses of given order.
+    // Compare discount product ids with those of given order.
     foreach ($order_wrapper->commerce_line_items as $wrapper_line_item) {
       // Ensures that the type of current line item is product.
       if ($wrapper_line_item->getBundle() == 'product') {
@@ -164,14 +188,19 @@ function commerce_discount_extra_line_item_order_contains_products_build($line_i
 
     return empty($products_sku);
   }
+
+  return FALSE;
 }
 
 /**
  * Inline conditions build callback: Determine if a user has a role.
  * Discount-type agnostic.
  *
- * @param type $wrapper
- * @param type $roles
+ * @param EntityDrupalWrapper $wrapper
+ *   The wrapped entity given by the rule.
+ * @param array $roles
+ *   Array of roles given by the rule.
+ *
  * @return boolean
  */
 function commerce_discount_extra_user_has_role_build(EntityDrupalWrapper $wrapper, $roles) {
@@ -198,20 +227,27 @@ function commerce_discount_extra_user_has_role_build(EntityDrupalWrapper $wrappe
 }
 
 /**
- * Inline conditions build callback: line item product comparison
+ * Inline conditions build callback: line item product comparison.
  *
  * @param EntityDrupalWrapper $line_item_wrapper
- * @param type $amount
- * @param type $operator
+ *   The wrapped entity given by the rule.
+ * @param array $price
+ *   Price array structure.
+ * @param string $operator
+ *   The comparison operator.
  * @param string $method
+ *   Calculation method
+ * @param bool $negate
+ *   Whether to negate the return.
+ *
  * @return boolean
  */
 function commerce_discount_extra_line_item_price_comp_build(EntityDrupalWrapper $line_item_wrapper, $price, $operator, $method, $negate) {
   // Ensure that it is a product line item and that it is the same currency as
   // the price argument.
   $line_item_total = $line_item_wrapper->commerce_total->value();
-  if (!in_array($line_item_wrapper->type->value(), commerce_product_line_item_types()) || $line_item_total['currency_code'] != $price['currency_code']) {
-    return;
+  if (!in_array($line_item_wrapper->getBundle(), commerce_product_line_item_types()) || $line_item_total['currency_code'] != $price['currency_code']) {
+    return FALSE;
   }
 
   // Calculate line item amount
@@ -224,8 +260,10 @@ function commerce_discount_extra_line_item_price_comp_build(EntityDrupalWrapper
     case 'calculated':
       // Get line item total
       $line_item_amount = $line_item_wrapper->commerce_total->amount->value();
-
       break;
+
+    // Invalid method.
+    default: return FALSE;
   }
 
   // Evaluate expression
@@ -233,12 +271,18 @@ function commerce_discount_extra_line_item_price_comp_build(EntityDrupalWrapper
 }
 
 /**
- * Inline conditions build callback: evaluate items in order condition
+ * Inline conditions build callback: evaluate items in order condition.
  *
- * @param EntityDrupalWrapper $entity
- * @param type $number
- * @param type $operator
- * @param type $negate
+ * @param EntityDrupalWrapper $entity_wrapper
+ *   The wrapped entity given by the rule.
+ * @param int $number
+ *   The number given by the rule.
+ * @param string $operator
+ *   The comparison operator.
+ * @param bool $negate
+ *   Whether to negate the return.
+ *
+ * @return boolean
  */
 function commerce_discount_extra_items_in_order_build(EntityDrupalWrapper $entity_wrapper, $number, $operator, $negate) {
   // Find the order depending on if the argument is an order or a line item.
@@ -254,7 +298,7 @@ function commerce_discount_extra_items_in_order_build(EntityDrupalWrapper $entit
   // Determine total item count on order.
   if (isset($order_wrapper)) {
     foreach ($order_wrapper->commerce_line_items as $line_item_wrapper) {
-      if (in_array($line_item_wrapper->type->value(), commerce_product_line_item_types())) {
+      if (in_array($line_item_wrapper->getBundle(), commerce_product_line_item_types())) {
         $qty += $line_item_wrapper->quantity->value();
       }
     }
@@ -265,21 +309,33 @@ function commerce_discount_extra_items_in_order_build(EntityDrupalWrapper $entit
 }
 
 /**
- * Inline conditions build callback: evaluate product quantity conditions
+ * Inline conditions build callback: evaluate product quantity conditions.
+ *
+ * @param EntityDrupalWrapper $line_item_wrapper
+ *   The wrapped entity given by the rule.
+ * @param array $products
+ *   The array of products given by the rule.
+ * @param string $operator
+ *   The comparison operator.
+ * @param int $quantity
+ *   The quantity given by the rule.
+ *
+ * @return bool
  */
-function commerce_discount_extra_line_item_has_specific_quantity_products_build($line_item_wrapper, $products, $operator, $quantity) {
+function commerce_discount_extra_line_item_has_specific_quantity_products_build(EntityDrupalWrapper $line_item_wrapper, $products, $operator, $quantity) {
   module_load_include('inc', 'commerce_discount', 'commerce_discount.rules');
 
   return commerce_order_has_specific_quantity_products_build($line_item_wrapper->order, $products, $operator, $quantity);
 }
 
 /**
- * Inline conditions configure callback
+ * Inline conditions configure callback.
  *
- * Configure role selection form
+ * Configure role selection form.
  *
- * @param type $settings
- * @return type
+ * @param array $settings
+ *
+ * @return array
  */
 function commerce_discount_extra_user_has_role_configure($settings) {
   $form['roles'] = array(
@@ -295,12 +351,13 @@ function commerce_discount_extra_user_has_role_configure($settings) {
 }
 
 /**
- * Inline conditions configure callback
+ * Inline conditions configure callback.
+ *
+ * Configure line item price comp form.
  *
- * Configure line item price comp form
+ * @param array $settings
  *
- * @param type $settings
- * @return type
+ * @return array
  */
 function commerce_discount_extra_line_item_price_comp_configure($settings) {
   // Expression operator
@@ -357,7 +414,7 @@ function commerce_discount_extra_line_item_price_comp_configure($settings) {
   return $form;
 }
 
-/*
+/**
  * Implements hook_commerce_discount_offer_type_info().
  */
 function commerce_discount_extra_commerce_discount_offer_type_info() {
@@ -377,7 +434,11 @@ function commerce_discount_extra_commerce_discount_offer_type_info() {
 }
 
 /**
- * Inline conditions configure callback: configure items in order condition
+ * Inline conditions configure callback: configure items in order condition.
+ *
+ * @param array $settings
+ *
+ * @return array
  */
 function commerce_discount_extra_items_in_order_configure($settings) {
   // Expression operator
@@ -411,7 +472,11 @@ function commerce_discount_extra_items_in_order_configure($settings) {
 }
 
 /**
- * Inline conditions configure callback: configure product type condition
+ * Inline conditions configure callback: configure product type condition.
+ *
+ * @param array $settings
+ *
+ * @return array
  */
 function commerce_discount_extra_line_item_has_product_type_configure($settings) {
   $form['product_types'] = array(
@@ -426,7 +491,7 @@ function commerce_discount_extra_line_item_has_product_type_configure($settings)
   return $form;
 }
 
-/*
+/**
  * Implements hook_flush_caches().
  */
 function commerce_discount_extra_flush_caches() {
@@ -434,7 +499,7 @@ function commerce_discount_extra_flush_caches() {
   commerce_discount_extra_install_helper();
 }
 
-/*
+/**
  * Implements hook_inline_conditions_build_alter().
  */
 function commerce_discount_extra_inline_conditions_build_alter(&$value) {
@@ -462,7 +527,7 @@ function commerce_discount_extra_inline_conditions_build_alter(&$value) {
 /**
  * Returns a list of operator labels keyed by symbol.
  *
- * @return type
+ * @return array
  */
 function _commerce_discount_extra_operator_options() {
   return array(
@@ -475,7 +540,7 @@ function _commerce_discount_extra_operator_options() {
 /**
  * Returns a list of comparison method options.
  *
- * @return type
+ * @return array
  */
 function _commerce_discount_extra_comp_method_options() {
   return array(
@@ -488,13 +553,15 @@ function _commerce_discount_extra_comp_method_options() {
  * Get the quantity of a given product in an order.
  *
  * @param EntityDrupalWrapper $order_wrapper
- * @param type $product_id
- * @return type
+ *   An order entity wrapper.
+ * @param array $product_ids
+ *   Array of product IDs
+ * @return int
  */
 function commerce_discount_extra_order_product_qty(EntityDrupalWrapper $order_wrapper, $product_ids) {
   $qty = 0;
   foreach ($order_wrapper->commerce_line_items as $line_item_wrapper) {
-    if ($line_item_wrapper->value() && in_array($line_item_wrapper->type->value(), commerce_product_line_item_types()) &&
+    if ($line_item_wrapper->value() && in_array($line_item_wrapper->getBundle(), commerce_product_line_item_types()) &&
         in_array($line_item_wrapper->commerce_product->getIdentifier(), $product_ids)) {
       $qty += $line_item_wrapper->quantity->value();
     }
@@ -506,11 +573,16 @@ function commerce_discount_extra_order_product_qty(EntityDrupalWrapper $order_wr
 /**
  * Evalute a simple expression with two values, an operator, and a negate flag.
  *
- * @param type $v1
- * @param type $v2
- * @param type $operator
- * @param type $negate
- * @return type
+ * @param int $v1
+ *   First value to compare.
+ * @param int $v2
+ *   Second value to compare.
+ * @param string $operator
+ *   The comparison operator.
+ * @param bool $negate
+ *   Whether to negate the return.
+ *
+ * @return bool
  */
 function _commerce_discount_extra_expression_eval($v1, $v2, $operator, $negate = FALSE) {
   switch ($operator) {
@@ -531,7 +603,7 @@ function _commerce_discount_extra_expression_eval($v1, $v2, $operator, $negate =
   return $negate ? !$result : $result;
 }
 
-/*
+/**
  * Implements hook_form_FORM_ID_alter().
  */
 function commerce_discount_extra_form_commerce_discount_form_alter(&$form, &$form_state) {
@@ -544,7 +616,7 @@ function commerce_discount_extra_form_commerce_discount_form_alter(&$form, &$for
   }
 }
 
-/*
+/**
  * Form validate callback: change empty string to integer for limit field
  */
 function commerce_discount_extra_fix_limit_data(&$form, &$form_state) {
