I've been using codesniffer on Commerce Shipping module. Found some errors. Fixed some. Welcome, reviewers.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sardis created an issue. See original summary.

Valentine94’s picture

Status: Needs review » Needs work

Hi Sardis.

Nice work, some small feedback:

+++ b/commerce_shipping.api.php
@@ -1,10 +1,13 @@
+ * @file Contains API for commerce shipping module.

File comment must be on a next line after @file.

+++ b/commerce_shipping.api.php
@@ -36,42 +39,42 @@ function hook_commerce_shipping_method_info_alter(&$shipping_methods) {
+ * @return array
+ *   An associative array of shipping service info arrays keyed by machine-name.
+ *   Each info array must contain values for the following keys:
+ *   - title: the human readable title of the shipping service
+ *   - shipping_method: the machine-name of the shipping method the service is for
+ *   - callbacks: an array of callback function names with the following keys:
+ *     - rate: the function used to generate the price array for the base rate of
+ *       the shipping service; rate callbacks are passed two parameters,
+ *       ($shipping_service, $order)
+ *   Values for the following keys are optional:
+ *   - display_title: the title used for the service on the front end; defaults to
+ *     the title
+ *   - description: a basic description of the service
+ *   - rules_component: boolean indicating whether or not a default Rules
+ *     component should be created to be used for enabling this service on a given
+ *     order; defaults to TRUE
+ *   - price_component: the name of the price component used in the unit price of
+ *     shipping line items for the service; defaults to the name of the shipping
+ *     service, which is important for data selection in Rules that may need to
+ *     use a variable to specify a price component... accordingly, beware of name
+ *     conflicts in your service names with other price components
+ *   - callbacks: additional callback function names may be specified for the
+ *     service with the following keys:
+ *     - details_form: the function used to generate a details form array for the
+ *       shipping service to collect additional information related to the service
+ *       on the checkout / admin forms; details form callbacks are passed five
+ *       parameters, ($pane_form, $pane_values, $checkout_pane, $order, $shipping_service)
+ *     - details_form_validate: the function used to validate input on the service
+ *       details form; details form validate callbacks are passed five parameters,
+ *       ($details_form, $details_values, $shipping_service, $order, $form_parents)
+ *     - details_form_submit: the function used to perform any additional
+ *       processing required on a shipping line item in light of the details form;
+ *       details form submit callbacks are passed three parameters,
+ *       ($details_form, $details_values, $line_item)
+ *   When loaded, a shipping service info array will also contain a module key
+ *   whose value is the name of the module that defined the service.

Please fix the lines which exceeds the 80 characters on a line.

+++ b/commerce_shipping.install
@@ -4,7 +4,6 @@
  * @file Contains updade hooks for the commerce_shipping module.

The same as the first point.

+++ b/commerce_shipping.install
@@ -51,6 +50,8 @@ function commerce_shipping_update_7001(&$sandbox) {
+ * Update hook 7002.

@@ -108,7 +110,10 @@ function commerce_shipping_update_7002(&$sandbox) {
+ * Update hook 7003.

@@ -124,6 +129,8 @@ function commerce_shipping_update_7003(&$sandbox) {
+ * Update hook 7004.

@@ -141,6 +148,8 @@ function commerce_shipping_update_7004($sandbox) {
+ * Update hook 7100.

hook_update_N should contain only the text about what it usually do in PHPDoc.

Sardis’s picture

Assigned: Sardis » Unassigned
Status: Needs work » Needs review
FileSize
45.92 KB

Thanks for the feedback. Made changes according to it.

Sardis’s picture

Small tabulation fixes on commerce_shipping_update_7003 and commerce_shipping_update_7004.

Valentine94’s picture

Status: Needs review » Reviewed & tested by the community

Nice, RTBC

  • das-peter committed b60c05d on 7.x-2.x authored by Sardis
    Issue #2755871 by Sardis, Valentine94: Fix coding standarts
    
das-peter’s picture

Status: Reviewed & tested by the community » Fixed

Nice! Will cause some re-rolls of other patches but now or never :P
Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.