You are here

function coder_47_reviews in Coder 6

Same name and namespace in other branches
  1. 5.2 includes/coder_47.inc \coder_47_reviews()
  2. 5 includes/coder_47.inc \coder_47_reviews()
  3. 6.2 includes/coder_47.inc \coder_47_reviews()

Implementation of hook_reviews().

File

includes/coder_47.inc, line 11
This include file implements coder functionality for 4.6 -> 4.7 upgrades.

Code

function coder_47_reviews() {
  $rules = array(
    array(
      '#type' => 'regex',
      '#value' => 'function\\s+\\w+(_node_name|_node_type)\\s*\\(',
      '#warning_callback' => '_coder_47_hook_node_info_warning',
    ),
    array(
      '#type' => 'regex',
      '#value' => '[\\s\\(]node_load\\s*\\(\\s*array\\s*\\(',
      '#warning_callback' => '_coder_47_node_load_warning',
    ),
    array(
      '#type' => 'regex',
      '#value' => '[\\s\\(]node_list\\s*\\(',
      '#warning_callback' => '_coder_47_node_list_warning',
    ),
    array(
      '#type' => 'regex',
      '#value' => '[\\s\\(]module_get_node_name\\s*\\(',
      '#warning_callback' => '_coder_47_module_get_name_warning',
    ),
    array(
      '#type' => 'regex',
      '#value' => '[\\s\\(]format_name\\s*\\(',
      '#warning_callback' => '_coder_47_format_name_warning',
    ),
    array(
      '#type' => 'regex',
      '#value' => '^\\s*(taxonomy_save_vocabulary|taxonomy_save_term)\\s*\\(',
      '#warning' => 'check the return and display a status message',
    ),
    array(
      '#type' => 'regex',
      '#value' => '[\\s\\(]message_access\\s*\\(',
      '#warning_callback' => '_coder_47_message_access_warning',
    ),
    array(
      '#type' => 'regex',
      '#value' => '[\\s\\(](strlen|strtolower|strtoupper|substr|ucfirst)\\s*\\(',
      '#warning' => 'in most cases, replace the string function with the drupal_ equivalent string functions',
      '#severity' => 'minor',
    ),
    array(
      '#type' => 'regex',
      '#value' => '[\\s\\(]conf_url_rewrite\\s*\\(',
      '#warning_callback' => '_coder_47_conf_url_rewrite_warning',
    ),
    array(
      '#type' => 'regex',
      '#value' => '[\\s\\(]node_delete\\s*\\(\\s*array\\s*\\(',
      '#warning_callback' => '_coder_47_node_delete_warning',
    ),
    array(
      '#type' => 'regex',
      '#source' => 'allphp',
      '#value' => '[\\s\\(]variable_get\\s*\\(\\s*[\'"]+file_directory_temp[\'"]+\\s*,',
      '#warning_callback' => '_coder_47_file_directory_temp_warning',
    ),
    array(
      '#type' => 'regex',
      '#source' => 'allphp',
      '#value' => '[\\s\\(]variable_get\\s*\\(\\s*[\'"]+file_directory_path[\'"]+\\s*,',
      '#warning_callback' => '_coder_47_file_directory_path_warning',
    ),
    array(
      '#type' => 'regex',
      '#value' => '[\\s\\(]array2object\\s*\\(',
      '#warning_callback' => '_coder_47_array2object_warning',
    ),
    array(
      '#type' => 'regex',
      '#value' => 'function\\s+\\w+_onload\\s*\\(',
      '#warning_callback' => '_coder_47_hook_onload_warning',
    ),
    array(
      '#type' => 'regex',
      '#value' => '[\\s\\(]node_validate_title\\s*\\(',
      '#warning_callback' => '_coder_47_node_validate_title_warning',
    ),
    array(
      '#type' => 'regex',
      '#value' => '[\\s\\(]tablesort_pager\\s*\\(',
      '#warning_callback' => '_coder_47_tablesort_pager_warning',
    ),
    array(
      '#type' => 'regex',
      '#value' => '[\\s\\(]form_(textfield|radio|group|select|checkbox|textarea)\\s*\\(',
      '#warning' => 'replace form_ functions with the forms api',
    ),
  );
  $review = array(
    '#title' => t('Converting 4.6.x modules to 4.7.x'),
    '#link' => 'http://drupal.org/node/22218',
    '#rules' => $rules,
    '#severity' => 'critical',
  );
  return array(
    'upgrade47' => $review,
  );
}