Hi!

Just a few coding standards improvements.

I hope to help.

Thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gmaltoni created an issue. See original summary.

gmaltoni’s picture

Patch with fixes.

markhalliwell’s picture

Category: Bug report » Task
Status: Needs review » Needs work
  1. +++ b/includes/callback.inc
    @@ -37,7 +38,12 @@ function js_callback_execute(array $info) {
    +      xhprof_enable(0, array(
    
    @@ -343,7 +350,86 @@ function js_callback_process_request(&$info) {
    +    $allowed_tags = array(
    

    Don't split these arrays out onto separate lines. It doesn't improve readability.

  2. +++ b/js.api.php
    @@ -1,8 +1,8 @@
    - * This file contains no working PHP code; it exists to provide documentation
    - * for this module's API.
    + * This file contains no working PHP code; it exists to provide documentation for this module's API.
    
    +++ b/js.install
    @@ -85,8 +85,7 @@ function js_uninstall() {
    -  // If the .htaccess contains references to js.php, notify the user they should 
    -  // clean it up.
    +  // If the .htaccess contains references to js.php, notify the user they should clean it up.
    
    +++ b/js.module
    @@ -596,9 +595,8 @@ function js_deliver($result, array $info = NULL) {
    - *   A boolean, set to FALSE if calling drupal_bootstrap from inside a
    - *   function called from drupal_bootstrap (recursion).
    ...
    + *   A boolean, set to FALSE if calling drupal_bootstrap from inside a function called from drupal_bootstrap (recursion).
    
    +++ b/js.php
    @@ -1,8 +1,8 @@
    - * An optimized page execution used to serve JavaScript AJAX requests using a
    - * minimally bootstrapped Drupal installation.
    + * An optimized page execution used to serve JavaScript AJAX requests using a minimally bootstrapped Drupal installation.
    

    Don't change comment lengths, these are wrapped on 80 character width limits (per coding standards BTW).

  3. +++ b/js.api.php
    @@ -13,7 +13,7 @@
    - *     If omitted, the default function name is: MODULE_js_callback_CALLBACK.
    + *     If omitted, the default function name is: module_js_callback_callback.
    
    @@ -232,7 +232,7 @@ function hook_js_callback_filter_xss_alter(array &$allowed_tags = array()) {
    -function MODULE_js_callback_CALLBACK($args, $data) {
    +function module_js_callback_callback($args, array $data) {
    
    +++ b/js.module
    @@ -245,7 +245,7 @@ function js_server_info($server = NULL, $reset = FALSE) {
    - * Implements MODULE_js_callback_CALLBACK().
    + * Implements module_js_callback_callback().
    
    +++ b/js_callback_examples/js_callback_examples.module
    @@ -138,7 +138,7 @@ function js_callback_examples_form($form, $form_state) {
    - * Implements MODULE_js_callback_CALLBACK().
    + * Implements module_js_callback_callback().
    

    Don't lowercase MODULE_js_callback_CALLBACK. The uppercase MODULE and CALLBACK indicate the variable names based on those two parameters (e.g. like HOOK in other APIs).

  4. +++ b/js.api.php
    @@ -212,7 +212,7 @@ function hook_js_callback_filter_xss_alter(array &$allowed_tags = array()) {
    - * @param mixed ...$args
    + * @param mixed $args
    

    This is a variadic function. The ellipsis indicates that multiple parameters can be passed. Don't remove this.

gmaltoni’s picture

Status: Needs work » Needs review
FileSize
8.75 KB

Hi @markcarver,

I've created a new patch to solve the topics pointed out in your comment.

Could you check this, please?

Best regards.

gmaltoni’s picture

Assigned: gmaltoni » Unassigned

markhalliwell’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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