From e42f0d8c9323601d312aca0798c69fb4e9ed441c Mon Sep 17 00:00:00 2001
From: aspilicious <aspilicious@172527.no-reply.drupal.org>
Date: Sun, 12 Aug 2012 13:37:59 +0200
Subject: [PATCH] Issue #1719188 by aspilicious: Coder cleanup.

---
 drush/views.drush.inc                         |  8 +-
 handlers/views_handler_argument.inc           |  3 +-
 handlers/views_handler_argument_date.inc      |  2 +-
 handlers/views_handler_field.inc              | 21 +++--
 .../views_handler_filter_boolean_operator.inc |  2 +-
 handlers/views_handler_filter_string.inc      |  6 +-
 includes/admin.inc                            | 82 ++++++++---------
 includes/handlers.inc                         | 92 ++++++++++---------
 .../views/Tests/Style/PluginStyleTest.php     | 18 ++--
 .../Style/PluginStyleUnformattedTest.php      |  2 +-
 lib/Drupal/views/Tests/WizardBasicTest.php    |  2 +-
 lib/Drupal/views/View.php                     | 12 +--
 lib/Drupal/views/ViewsObject.php              | 10 +-
 modules/comment.views_default.inc             |  2 +-
 .../comment/views_handler_field_comment.inc   |  2 +-
 .../views_handler_field_comment_link.inc      |  2 +-
 modules/statistics.views_default.inc          |  2 +-
 .../views_handler_field_term_node_tid.inc     |  6 +-
 ...s_plugin_argument_default_taxonomy_tid.inc |  4 +-
 plugins/views_plugin_cache.inc                |  4 +-
 plugins/views_plugin_display_attachment.inc   |  2 +-
 plugins/views_plugin_display_block.inc        |  2 +-
 plugins/views_plugin_display_feed.inc         |  2 +-
 plugins/views_plugin_display_page.inc         |  8 +-
 plugins/views_plugin_exposed_form.inc         |  7 +-
 plugins/views_plugin_pager_full.inc           |  8 +-
 plugins/views_plugin_query_default.inc        | 14 +--
 .../views_ui_base_views_wizard.class.php      | 20 ++--
 theme/views-ui-display-tab-bucket.tpl.php     |  2 +-
 views.module                                  |  2 +-
 30 files changed, 176 insertions(+), 173 deletions(-)

diff --git a/drush/views.drush.inc b/drush/views.drush.inc
index f8d76e80fa12..dd83cd837f17 100644
--- a/drush/views.drush.inc
+++ b/drush/views.drush.inc
@@ -146,7 +146,7 @@ function views_revert_views() {
         drush_set_error(dt("The view specified '@viewname' is not overridden.", array('@viewname' => $viewname)));
       }
       // If the view is overriden, revert it.
-      elseif ($is_overridden){
+      elseif ($is_overridden) {
         views_revert_view($views[$viewname]);
         $i++;
       }
@@ -317,7 +317,7 @@ function drush_views_list() {
   );
 
   // setup a row for each view
-  foreach($views as $id => $view){
+  foreach ($views as $id => $view) {
     // if options were specified, check that first
     // mismatch push the loop to the next view
     if ($with_tags && !in_array($view->tag, $tags)) {
@@ -343,7 +343,7 @@ function drush_views_list() {
 
     // place the row in the appropiate array,
     // so we can have disabled views at the bottom
-    if($view->disabled) {
+    if ($view->disabled) {
       $disabled_views[] = $row;
       }
     else{
@@ -352,7 +352,7 @@ function drush_views_list() {
     unset($row);
 
     // gather some statistics
-    switch($view->type) {
+    switch ($view->type) {
       case dt('Normal'):
         $indb++;
         break;
diff --git a/handlers/views_handler_argument.inc b/handlers/views_handler_argument.inc
index 526b765753e1..8c4f9de1ec01 100644
--- a/handlers/views_handler_argument.inc
+++ b/handlers/views_handler_argument.inc
@@ -909,8 +909,7 @@ function summary_basics($count_field = TRUE) {
     // Add the number of nodes counter
     $distinct = ($this->view->display_handler->get_option('distinct') && empty($this->query->no_distinct));
 
-    $count_alias = $this->query->add_field($this->query->base_table, $this->query->base_field, 'num_records',
-                                           array('count' => TRUE, 'distinct' => $distinct));
+    $count_alias = $this->query->add_field($this->query->base_table, $this->query->base_field, 'num_records', array('count' => TRUE, 'distinct' => $distinct));
     $this->query->add_groupby($this->name_alias);
 
     if ($count_field) {
diff --git a/handlers/views_handler_argument_date.inc b/handlers/views_handler_argument_date.inc
index 6803c36068a0..ee92de900ec0 100644
--- a/handlers/views_handler_argument_date.inc
+++ b/handlers/views_handler_argument_date.inc
@@ -44,7 +44,7 @@ function get_default_argument($raw = FALSE) {
     if (!$raw && $this->options['default_argument_type'] == 'date') {
       return date($this->arg_format, REQUEST_TIME);
     }
-    else if (!$raw && in_array($this->options['default_argument_type'], array('node_created', 'node_changed'))) {
+    elseif (!$raw && in_array($this->options['default_argument_type'], array('node_created', 'node_changed'))) {
       foreach (range(1, 3) as $i) {
         $node = menu_get_object('node', $i);
         if (!empty($node)) {
diff --git a/handlers/views_handler_field.inc b/handlers/views_handler_field.inc
index 5b8cd6305495..b3a818dca5e3 100644
--- a/handlers/views_handler_field.inc
+++ b/handlers/views_handler_field.inc
@@ -1255,7 +1255,7 @@ function render_text($alter) {
 
     if (!empty($alter['make_link']) && !empty($alter['path'])) {
       if (!isset($tokens)) {
-       $tokens = $this->get_render_tokens($alter);
+        $tokens = $this->get_render_tokens($alter);
       }
       $value = $this->render_as_link($alter, $value, $tokens);
     }
@@ -1341,7 +1341,7 @@ function render_as_link($alter, $text, $tokens) {
     // If no scheme is provided in the $path, assign the default 'http://'.
     // This allows a url of 'www.example.com' to be converted to 'http://www.example.com'.
     // Only do this on for external URLs.
-    if ($alter['external']){
+    if ($alter['external']) {
       if (!isset($url['scheme'])) {
         // There is no scheme, add the default 'http://' to the $path.
         $path = "http://$path";
@@ -1386,7 +1386,7 @@ function render_as_link($alter, $text, $tokens) {
       $options['attributes']['rel'] = $rel;
     }
 
-    $target = check_plain(trim(strtr($alter['target'],$tokens)));
+    $target = check_plain(trim(strtr($alter['target'], $tokens)));
     if (!empty($target)) {
       $options['attributes']['target'] = $target;
     }
@@ -1530,13 +1530,14 @@ function get_token_values_recursive(array $array, array $parent_keys = array())
 
     foreach ($array as $param => $val) {
       if (is_array($val)) {
-         // Copy parent_keys array, so we don't afect other elements of this iteration.
-         $child_parent_keys = $parent_keys;
-         $child_parent_keys[] = $param;
-         // Get the child tokens.
-         $child_tokens = $this->get_token_values_recursive($val, $child_parent_keys);
-         // Add them to the current tokens array.
-         $tokens += $child_tokens;
+        // Copy parent_keys array, so we don't affect other elements of this
+        // iteration.
+        $child_parent_keys = $parent_keys;
+        $child_parent_keys[] = $param;
+        // Get the child tokens.
+        $child_tokens = $this->get_token_values_recursive($val, $child_parent_keys);
+        // Add them to the current tokens array.
+        $tokens += $child_tokens;
       }
       else {
         // Create a token key based on array element structure.
diff --git a/handlers/views_handler_filter_boolean_operator.inc b/handlers/views_handler_filter_boolean_operator.inc
index ea967871ede7..0d70831212d4 100644
--- a/handlers/views_handler_filter_boolean_operator.inc
+++ b/handlers/views_handler_filter_boolean_operator.inc
@@ -37,7 +37,7 @@ function construct() {
     if (isset($this->definition['accept null'])) {
       $this->accept_null = (bool) $this->definition['accept null'];
     }
-    else if (isset($this->definition['accept_null'])) {
+    elseif (isset($this->definition['accept_null'])) {
       $this->accept_null = (bool) $this->definition['accept_null'];
     }
     $this->value_options = NULL;
diff --git a/handlers/views_handler_filter_string.inc b/handlers/views_handler_filter_string.inc
index 4c9177d8ad0b..5fbbdeaf0438 100644
--- a/handlers/views_handler_filter_string.inc
+++ b/handlers/views_handler_filter_string.inc
@@ -156,7 +156,7 @@ function admin_summary() {
 
     $options = $this->operator_options('short');
     $output = '';
-    if(!empty($options[$this->operator])) {
+    if (!empty($options[$this->operator])) {
       $output = check_plain($options[$this->operator]);
     }
     if (in_array($this->operator, $this->operator_values(1))) {
@@ -269,11 +269,11 @@ function op_word($field) {
 
     preg_match_all('/ (-?)("[^"]+"|[^" ]+)/i', ' ' . $this->value, $matches, PREG_SET_ORDER);
     foreach ($matches as $match) {
-      $phrase = false;
+      $phrase = FALSE;
       // Strip off phrase quotes
       if ($match[2]{0} == '"') {
         $match[2] = substr($match[2], 1, -1);
-        $phrase = true;
+        $phrase = TRUE;
       }
       $words = trim($match[2], ',?!();:-');
       $words = $phrase ? array($words) : preg_split('/ /', $words, -1, PREG_SPLIT_NO_EMPTY);
diff --git a/includes/admin.inc b/includes/admin.inc
index ea882a5915b8..52af8a27b4cb 100644
--- a/includes/admin.inc
+++ b/includes/admin.inc
@@ -45,7 +45,7 @@ function views_ui_get_admin_css() {
           'group' => CSS_THEME,
         );
       }
-      else if (file_exists($theme_path . "/views-admin.$theme_key.css")) {
+      elseif (file_exists($theme_path . "/views-admin.$theme_key.css")) {
         $list[$theme_path . "/views-admin.$theme_key.css"] = array(
           'group' => CSS_THEME,
         );
@@ -95,7 +95,7 @@ function views_ui_check_advanced_help() {
     $filename = db_query_range("SELECT filename FROM {system} WHERE type = 'module' AND name = 'advanced_help'", 0, 1)
       ->fetchField();
     if ($filename && file_exists($filename)) {
-      drupal_set_message(t('If you <a href="@modules">enable the advanced help module</a>, Views will provide more and better help. <a href="@hide">Hide this message.</a>', array('@modules' => url('admin/modules'),'@hide' => url('admin/structure/views/settings'))));
+      drupal_set_message(t('If you <a href="@modules">enable the advanced help module</a>, Views will provide more and better help. <a href="@hide">Hide this message.</a>', array('@modules' => url('admin/modules'), '@hide' => url('admin/structure/views/settings'))));
     }
     else {
       drupal_set_message(t('If you install the advanced help module from !href, Views will provide more and better help. <a href="@hide">Hide this message.</a>', array('!href' => l('http://drupal.org/project/advanced_help', 'http://drupal.org/project/advanced_help'), '@hide' => url('admin/structure/views/settings'))));
@@ -589,7 +589,7 @@ function views_ui_add_ajax_trigger(&$wrapping_element, $trigger_key, $refresh_pa
     $wrapping_element[$button_key]['#value'] = t('Update "@title" choice (@number)', array(
       '@title' => $button_title,
       '@number' => ++$seen_buttons[$button_title],
-   ));
+    ));
   }
 
   // Attach custom data to the triggering element and submit button, so we can
@@ -848,7 +848,7 @@ function theme_views_ui_view_info($variables) {
   $output .= '<div class="views-ui-view-title">' . $title . "</div>\n";
   $output .= '<div class="views-ui-view-displays">' . $displays . "</div>\n";
   $output .= '<div class="views-ui-view-storage">' . $type . "</div>\n";
-  $output .= '<div class="views-ui-view-base">' . t('Type') . ': ' . $variables['base']. "</div>\n";
+  $output .= '<div class="views-ui-view-base">' . t('Type') . ': ' . $variables['base'] . "</div>\n";
   return $output;
 }
 
@@ -1187,7 +1187,7 @@ function views_ui_preview_form($form, &$form_state, $view, $display_id = 'defaul
   $form_state['no_cache'] = TRUE;
   $form_state['view'] = $view;
 
-  $form['#attributes'] = array('class' => array('clearfix',));
+  $form['#attributes'] = array('class' => array('clearfix'));
 
   // Add a checkbox controlling whether or not this display auto-previews.
   $form['live_preview'] = array(
@@ -1555,29 +1555,29 @@ function views_ui_get_display_tab_details($view, $display) {
   $display_title = views_ui_get_display_label($view, $display->id, FALSE);
   $build = array(
     '#theme_wrappers' => array('container'),
-    '#attributes' => array('id' => 'edit-display-settings-details',),
+    '#attributes' => array('id' => 'edit-display-settings-details'),
   );
 
   $plugin = views_fetch_plugin_data('display', $view->display[$display->id]->display_plugin);
   // The following is for display purposes only. We need to determine if there is more than one button and wrap
   // the buttons in a .ctools-dropbutton class if more than one is present.  Otherwise, we'll just wrap the
   // actions in the .ctools-button class.
-  $isDisplayDeleted = !empty($display->deleted);
-  $isDeletable = empty($plugin['no remove']);
+  $is_display_deleted = !empty($display->deleted);
+  $is_deletable = empty($plugin['no remove']);
   // The master display cannot be cloned.
-  $isDefault = $display->id == 'default';
+  $is_default = $display->id == 'default';
   // @todo: Figure out why get_option doesn't work here.
-  $isEnabled = $display->handler->get_option('enabled');
+  $is_enabled = $display->handler->get_option('enabled');
 
-  if (!$isDisplayDeleted && $isDeletable && !$isDefault) {
+  if (!$is_display_deleted && $is_deletable && !$is_default) {
     $prefix = '<div class="ctools-no-js ctools-button ctools-dropbutton"><div class="ctools-link"><a href="#" class="ctools-twisty ctools-text">open</a></div><div class="ctools-content"><ul class="horizontal right actions">';
     $suffix = '</ul></div></div>';
-    $itemElement = 'li';
+    $item_element = 'li';
   }
   else {
     $prefix = '<div class="ctools-button"><div class="ctools-content"><ul class="horizontal right actions">';
     $suffix = '</ul></div></div>';
-    $itemElement = 'li';
+    $item_element = 'li';
   }
 
   if ($display->id != 'default') {
@@ -1591,15 +1591,15 @@ function views_ui_get_display_tab_details($view, $display) {
       '#suffix' => $suffix,
     );
 
-    if (!$isDisplayDeleted) {
-      if (!$isEnabled) {
+    if (!$is_display_deleted) {
+      if (!$is_enabled) {
         $build['top']['actions']['enable'] = array(
           '#type' => 'submit',
           '#value' => t('enable @display_title', array('@display_title' => $display_title)),
           '#limit_validation_errors' => array(),
           '#submit' => array('views_ui_edit_form_submit_enable_display', 'views_ui_edit_form_submit_delay_destination'),
-          '#prefix' => '<' . $itemElement . ' class="enable">',
-          "#suffix" => '</' . $itemElement . '>',
+          '#prefix' => '<' . $item_element . ' class="enable">',
+          "#suffix" => '</' . $item_element . '>',
         );
       }
       // Add a link to view the page.
@@ -1611,39 +1611,39 @@ function views_ui_get_display_tab_details($view, $display) {
             '#title' => t('view @display', array('@display' => $display->display_title)),
             '#options' => array('alt' => array(t("Go to the real page for this display"))),
             '#href' => $path,
-            '#prefix' => '<' . $itemElement . ' class="view">',
-            "#suffix" => '</' . $itemElement . '>',
+            '#prefix' => '<' . $item_element . ' class="view">',
+            "#suffix" => '</' . $item_element . '>',
           );
         }
       }
-      if (!$isDefault) {
+      if (!$is_default) {
         $build['top']['actions']['duplicate'] = array(
           '#type' => 'submit',
           '#value' => t('clone @display_title', array('@display_title' => $display_title)),
           '#limit_validation_errors' => array(),
           '#submit' => array('views_ui_edit_form_submit_duplicate_display', 'views_ui_edit_form_submit_delay_destination'),
-          '#prefix' => '<' . $itemElement . ' class="duplicate">',
-          "#suffix" => '</' . $itemElement . '>',
+          '#prefix' => '<' . $item_element . ' class="duplicate">',
+          "#suffix" => '</' . $item_element . '>',
         );
       }
-      if ($isDeletable) {
+      if ($is_deletable) {
         $build['top']['actions']['delete'] = array(
           '#type' => 'submit',
           '#value' => t('delete @display_title', array('@display_title' => $display_title)),
           '#limit_validation_errors' => array(),
           '#submit' => array('views_ui_edit_form_submit_delete_display', 'views_ui_edit_form_submit_delay_destination'),
-          '#prefix' => '<' . $itemElement . ' class="delete">',
-          "#suffix" => '</' . $itemElement . '>',
+          '#prefix' => '<' . $item_element . ' class="delete">',
+          "#suffix" => '</' . $item_element . '>',
         );
       }
-      if ($isEnabled) {
+      if ($is_enabled) {
         $build['top']['actions']['disable'] = array(
           '#type' => 'submit',
           '#value' => t('disable @display_title', array('@display_title' => $display_title)),
           '#limit_validation_errors' => array(),
           '#submit' => array('views_ui_edit_form_submit_disable_display', 'views_ui_edit_form_submit_delay_destination'),
-          '#prefix' => '<' . $itemElement . ' class="disable">',
-          "#suffix" => '</' . $itemElement . '>',
+          '#prefix' => '<' . $item_element . ' class="disable">',
+          "#suffix" => '</' . $item_element . '>',
         );
       }
     }
@@ -1653,8 +1653,8 @@ function views_ui_get_display_tab_details($view, $display) {
         '#value' => t('undo delete of @display_title', array('@display_title' => $display_title)),
         '#limit_validation_errors' => array(),
         '#submit' => array('views_ui_edit_form_submit_undo_delete_display', 'views_ui_edit_form_submit_delay_destination'),
-        '#prefix' => '<' . $itemElement . ' class="undo-delete">',
-        "#suffix" => '</' . $itemElement . '>',
+        '#prefix' => '<' . $item_element . ' class="undo-delete">',
+        "#suffix" => '</' . $item_element . '>',
       );
     }
 
@@ -1668,7 +1668,7 @@ function views_ui_get_display_tab_details($view, $display) {
 
   $build['columns'] = array();
   $build['columns']['#theme_wrappers'] = array('container');
-  $build['columns']['#attributes'] = array('id' => 'edit-display-settings-main', 'class' => array('clearfix', 'views-display-columns'),);
+  $build['columns']['#attributes'] = array('id' => 'edit-display-settings-main', 'class' => array('clearfix', 'views-display-columns'));
 
   $build['columns']['first']['#theme_wrappers'] = array('container');
   $build['columns']['first']['#attributes'] = array('class' => array('views-display-column', 'first'));
@@ -1693,9 +1693,9 @@ function views_ui_get_display_tab_details($view, $display) {
   if (!config('views.settings')->get('views_ui_show_advanced_column')) {
     $build['columns']['third']['#attributes']['class'][] = 'ctools-collapsed';
   }
-  $build['columns']['third']['advanced'] = array('#markup' => '<h3 class="ctools-collapsible-handle"><a href="">' . t('Advanced') . '</a></h3>',);
+  $build['columns']['third']['advanced'] = array('#markup' => '<h3 class="ctools-collapsible-handle"><a href="">' . t('Advanced') . '</a></h3>');
   $build['columns']['third']['collapse']['#theme_wrappers'] = array('container');
-  $build['columns']['third']['collapse']['#attributes'] = array('class' => array('ctools-collapsible-content',),);
+  $build['columns']['third']['collapse']['#attributes'] = array('class' => array('ctools-collapsible-content'));
 
   // Each option (e.g. title, access, display as grid/table/list) fits into one
   // of several "buckets," or boxes (Format, Fields, Sort, and so on).
@@ -2248,7 +2248,7 @@ function views_ui_edit_form_get_bucket($type, $view, $display) {
   $actions['add'] = array(
     'title' => t('Add'),
     'href' => "admin/structure/views/nojs/add-item/$view->name/$display->id/$type",
-    'attributes'=> array('class' => array('icon compact add', 'views-ajax-link'), 'title' => t('Add'), 'id' => 'views-add-' . $type),
+    'attributes' => array('class' => array('icon compact add', 'views-ajax-link'), 'title' => t('Add'), 'id' => 'views-add-' . $type),
     'html' => TRUE,
   );
   if ($count_handlers > 0) {
@@ -2347,11 +2347,11 @@ function views_ui_edit_form_get_bucket($type, $view, $display) {
     }
 
     if ($display->handler->use_group_by() && $handler->use_group_by()) {
-      $build['fields'][$id]['#settings_links'][] = l('<span class="label">' . t('Aggregation settings') . '</span>', "admin/structure/views/nojs/config-item-group/$view->name/$display->id/$type/$id", array('attributes' => array('class' => 'views-button-configure views-ajax-link', 'title' => t('Aggregation settings')), 'html' => true));
+      $build['fields'][$id]['#settings_links'][] = l('<span class="label">' . t('Aggregation settings') . '</span>', "admin/structure/views/nojs/config-item-group/$view->name/$display->id/$type/$id", array('attributes' => array('class' => 'views-button-configure views-ajax-link', 'title' => t('Aggregation settings')), 'html' => TRUE));
     }
 
     if ($handler->has_extra_options()) {
-      $build['fields'][$id]['#settings_links'][] = l('<span class="label">' . t('Settings') . '</span>', "admin/structure/views/nojs/config-item-extra/$view->name/$display->id/$type/$id", array('attributes' => array('class' => array('views-button-configure', 'views-ajax-link'), 'title' => t('Settings')), 'html' => true));
+      $build['fields'][$id]['#settings_links'][] = l('<span class="label">' . t('Settings') . '</span>', "admin/structure/views/nojs/config-item-extra/$view->name/$display->id/$type/$id", array('attributes' => array('class' => array('views-button-configure', 'views-ajax-link'), 'title' => t('Settings')), 'html' => TRUE));
     }
 
     if ($grouping) {
@@ -3106,7 +3106,7 @@ function _views_position_sort($display1, $display2) {
  * Submit handler for rearranging display form
  */
 function views_ui_reorder_displays_form_submit($form, &$form_state) {
-  foreach($form_state['input'] as $display => $info) {
+  foreach ($form_state['input'] as $display => $info) {
     // add each value that is a field with a weight to our list, but only if
     // it has had its 'removed' checkbox checked.
     if (is_array($info) && isset($info['weight']) && empty($info['removed'])) {
@@ -3120,13 +3120,13 @@ function views_ui_reorder_displays_form_submit($form, &$form_state) {
   // Fixing up positions
   $position = 2;
 
-  foreach(array_keys($order) as $display) {
+  foreach (array_keys($order) as $display) {
     $order[$display] = $position++;
   }
 
   // Setting up position and removing deleted displays
   $displays = $form_state['view']->display;
-  foreach($displays as $display_id => $display) {
+  foreach ($displays as $display_id => $display) {
     // Don't touch the default !!!
     if ($display_id === 'default') {
       continue;
@@ -3632,7 +3632,7 @@ function views_ui_rearrange_filter_form($form, &$form_state) {
   $form['filter_groups']['#tree'] = TRUE;
   $form['filter_groups']['operator'] = array(
     '#type' => 'select',
-    '#options' => array (
+    '#options' => array(
       'AND' => t('And'),
       'OR' => t('Or'),
     ),
@@ -3801,7 +3801,7 @@ function theme_views_ui_rearrange_filter_form(&$vars) {
         $form['filters'][$id]['group']['#attributes']['class'] = array('views-group-select views-group-select-' . $group_id);
         $row[] = drupal_render($form['filters'][$id]['group']);
         $form['filters'][$id]['removed']['#attributes']['class'][] = 'js-hide';
-        $row[] = drupal_render($form['filters'][$id]['removed']) . l('<span>' . t('Remove') . '</span>', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $id, 'class' => array('views-hidden', 'views-button-remove', 'views-groups-remove-link', 'views-remove-link'), 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => true));
+        $row[] = drupal_render($form['filters'][$id]['removed']) . l('<span>' . t('Remove') . '</span>', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $id, 'class' => array('views-hidden', 'views-button-remove', 'views-groups-remove-link', 'views-remove-link'), 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => TRUE));
 
         $row = array('data' => $row, 'class' => array('draggable'), 'id' => 'views-row-' . $id);
         if ($group_id !== 'ungroupable') {
diff --git a/includes/handlers.inc b/includes/handlers.inc
index 8ae09f0d0b6b..254cf56f5f86 100644
--- a/includes/handlers.inc
+++ b/includes/handlers.inc
@@ -48,12 +48,12 @@ function _views_create_handler($definition, $type = 'handler', $handler_type = N
     return;
   }
 
-   if (!empty($definition['override handler'])) {
-     $handler = new $definition['override handler'];
-   }
-   else {
-     $handler = new $definition['handler'];
-   }
+  if (!empty($definition['override handler'])) {
+    $handler = new $definition['override handler'];
+  }
+  else {
+    $handler = new $definition['handler'];
+  }
 
   $handler->set_definition($definition);
   if ($type == 'handler') {
@@ -1185,7 +1185,7 @@ function views_get_timezone() {
         db_query("SET @@session.time_zone = '$offset'");
       }
 
-      $already_set = true;
+      $already_set = TRUE;
     }
   }
 
@@ -1357,44 +1357,46 @@ function views_date_sql_extract($extract_type, $field, $field_type = 'int', $set
   // Note there is no space after FROM to avoid db_rewrite problems
   // see http://drupal.org/node/79904.
   switch ($extract_type) {
-  case('DATE'):
-    return $field;
-  case('YEAR'):
-    return "EXTRACT(YEAR FROM($field))";
-  case('MONTH'):
-    return "EXTRACT(MONTH FROM($field))";
-  case('DAY'):
-    return "EXTRACT(DAY FROM($field))";
-  case('HOUR'):
-    return "EXTRACT(HOUR FROM($field))";
-  case('MINUTE'):
-    return "EXTRACT(MINUTE FROM($field))";
-  case('SECOND'):
-    return "EXTRACT(SECOND FROM($field))";
-  case('WEEK'):  // ISO week number for date
-    switch ($db_type) {
-      case('mysql'):
-        // WEEK using arg 3 in mysql should return the same value as postgres EXTRACT
-        return "WEEK($field, 3)";
-      case('pgsql'):
-        return "EXTRACT(WEEK FROM($field))";
-    }
-  case('DOW'):
-    switch ($db_type) {
-      case('mysql'):
-        // mysql returns 1 for Sunday through 7 for Saturday
-        // php date functions and postgres use 0 for Sunday and 6 for Saturday
-        return "INTEGER(DAYOFWEEK($field) - 1)";
-      case('pgsql'):
-        return "EXTRACT(DOW FROM($field))";
-    }
-  case('DOY'):
-    switch ($db_type) {
-      case('mysql'):
-        return "DAYOFYEAR($field)";
-      case('pgsql'):
-        return "EXTRACT(DOY FROM($field))";
-    }
+    case 'DATE':
+      return $field;
+    case 'YEAR':
+      return "EXTRACT(YEAR FROM($field))";
+    case 'MONTH':
+      return "EXTRACT(MONTH FROM($field))";
+    case 'DAY':
+      return "EXTRACT(DAY FROM($field))";
+    case 'HOUR':
+      return "EXTRACT(HOUR FROM($field))";
+    case 'MINUTE':
+      return "EXTRACT(MINUTE FROM($field))";
+    case 'SECOND':
+      return "EXTRACT(SECOND FROM($field))";
+    // ISO week number for date
+    case 'WEEK':
+      switch ($db_type) {
+        case 'mysql':
+          // WEEK using arg 3 in mysql should return the same value as postgres
+          // EXTRACT.
+          return "WEEK($field, 3)";
+        case 'pgsql':
+          return "EXTRACT(WEEK FROM($field))";
+      }
+    case 'DOW':
+      switch ($db_type) {
+        case 'mysql':
+          // mysql returns 1 for Sunday through 7 for Saturday php date
+          // functions and postgres use 0 for Sunday and 6 for Saturday.
+          return "INTEGER(DAYOFWEEK($field) - 1)";
+        case 'pgsql':
+          return "EXTRACT(DOW FROM($field))";
+      }
+    case 'DOY':
+      switch ($db_type) {
+        case 'mysql':
+          return "DAYOFYEAR($field)";
+        case 'pgsql':
+          return "EXTRACT(DOY FROM($field))";
+      }
   }
 }
 
diff --git a/lib/Drupal/views/Tests/Style/PluginStyleTest.php b/lib/Drupal/views/Tests/Style/PluginStyleTest.php
index 44522599ec72..76c7d95b4c29 100644
--- a/lib/Drupal/views/Tests/Style/PluginStyleTest.php
+++ b/lib/Drupal/views/Tests/Style/PluginStyleTest.php
@@ -65,16 +65,16 @@ function testGroupingLegacy() {
     $expected = array();
     // Use Job: as label, so be sure that the label is used for groupby as well.
     $expected['Job: Singer'] = array();
-    $expected['Job: Singer'][0] = new StdClass();
+    $expected['Job: Singer'][0] = new stdClass();
     $expected['Job: Singer'][0]->views_test_name = 'John';
     $expected['Job: Singer'][0]->views_test_job = 'Singer';
     $expected['Job: Singer'][0]->views_test_id = '1';
-    $expected['Job: Singer'][1] = new StdClass();
+    $expected['Job: Singer'][1] = new stdClass();
     $expected['Job: Singer'][1]->views_test_name = 'George';
     $expected['Job: Singer'][1]->views_test_job = 'Singer';
     $expected['Job: Singer'][1]->views_test_id = '2';
     $expected['Job: Drummer'] = array();
-    $expected['Job: Drummer'][2] = new StdClass();
+    $expected['Job: Drummer'][2] = new stdClass();
     $expected['Job: Drummer'][2]->views_test_name = 'Ringo';
     $expected['Job: Drummer'][2]->views_test_job = 'Drummer';
     $expected['Job: Drummer'][2]->views_test_id = '3';
@@ -84,17 +84,17 @@ function testGroupingLegacy() {
     $expected = array();
     $expected['Job: Singer'] = array();
     $expected['Job: Singer']['group'] = 'Job: Singer';
-    $expected['Job: Singer']['rows'][0] = new StdClass();
+    $expected['Job: Singer']['rows'][0] = new stdClass();
     $expected['Job: Singer']['rows'][0]->views_test_name = 'John';
     $expected['Job: Singer']['rows'][0]->views_test_job = 'Singer';
     $expected['Job: Singer']['rows'][0]->views_test_id = '1';
-    $expected['Job: Singer']['rows'][1] = new StdClass();
+    $expected['Job: Singer']['rows'][1] = new stdClass();
     $expected['Job: Singer']['rows'][1]->views_test_name = 'George';
     $expected['Job: Singer']['rows'][1]->views_test_job = 'Singer';
     $expected['Job: Singer']['rows'][1]->views_test_id = '2';
     $expected['Job: Drummer'] = array();
     $expected['Job: Drummer']['group'] = 'Job: Drummer';
-    $expected['Job: Drummer']['rows'][2] = new StdClass();
+    $expected['Job: Drummer']['rows'][2] = new stdClass();
     $expected['Job: Drummer']['rows'][2]->views_test_name = 'Ringo';
     $expected['Job: Drummer']['rows'][2]->views_test_job = 'Drummer';
     $expected['Job: Drummer']['rows'][2]->views_test_id = '3';
@@ -169,14 +169,14 @@ function _testGrouping($stripped = FALSE) {
     $expected['Job: Singer']['group'] = 'Job: Singer';
     $expected['Job: Singer']['rows']['Age: 25'] = array();
     $expected['Job: Singer']['rows']['Age: 25']['group'] = 'Age: 25';
-    $expected['Job: Singer']['rows']['Age: 25']['rows'][0] = new StdClass();
+    $expected['Job: Singer']['rows']['Age: 25']['rows'][0] = new stdClass();
     $expected['Job: Singer']['rows']['Age: 25']['rows'][0]->views_test_name = 'John';
     $expected['Job: Singer']['rows']['Age: 25']['rows'][0]->views_test_job = 'Singer';
     $expected['Job: Singer']['rows']['Age: 25']['rows'][0]->views_test_age = '25';
     $expected['Job: Singer']['rows']['Age: 25']['rows'][0]->views_test_id = '1';
     $expected['Job: Singer']['rows']['Age: 27'] = array();
     $expected['Job: Singer']['rows']['Age: 27']['group'] = 'Age: 27';
-    $expected['Job: Singer']['rows']['Age: 27']['rows'][1] = new StdClass();
+    $expected['Job: Singer']['rows']['Age: 27']['rows'][1] = new stdClass();
     $expected['Job: Singer']['rows']['Age: 27']['rows'][1]->views_test_name = 'George';
     $expected['Job: Singer']['rows']['Age: 27']['rows'][1]->views_test_job = 'Singer';
     $expected['Job: Singer']['rows']['Age: 27']['rows'][1]->views_test_age = '27';
@@ -185,7 +185,7 @@ function _testGrouping($stripped = FALSE) {
     $expected['Job: Drummer']['group'] = 'Job: Drummer';
     $expected['Job: Drummer']['rows']['Age: 28'] = array();
     $expected['Job: Drummer']['rows']['Age: 28']['group'] = 'Age: 28';
-    $expected['Job: Drummer']['rows']['Age: 28']['rows'][2] = new StdClass();
+    $expected['Job: Drummer']['rows']['Age: 28']['rows'][2] = new stdClass();
     $expected['Job: Drummer']['rows']['Age: 28']['rows'][2]->views_test_name = 'Ringo';
     $expected['Job: Drummer']['rows']['Age: 28']['rows'][2]->views_test_job = 'Drummer';
     $expected['Job: Drummer']['rows']['Age: 28']['rows'][2]->views_test_age = '28';
diff --git a/lib/Drupal/views/Tests/Style/PluginStyleUnformattedTest.php b/lib/Drupal/views/Tests/Style/PluginStyleUnformattedTest.php
index 608951eac812..a048d9bdfc22 100644
--- a/lib/Drupal/views/Tests/Style/PluginStyleUnformattedTest.php
+++ b/lib/Drupal/views/Tests/Style/PluginStyleUnformattedTest.php
@@ -67,7 +67,7 @@ function testDefaultRowClasses() {
       if ($count == 1) {
         $this->assertTrue(strpos($class, "views-row-first") !== FALSE, 'Take sure that the first class is set right.');
       }
-      else if ($count == $count_result) {
+      elseif ($count == $count_result) {
         $this->assertTrue(strpos($class, "views-row-last") !== FALSE, 'Take sure that the last class is set right.');
 
       }
diff --git a/lib/Drupal/views/Tests/WizardBasicTest.php b/lib/Drupal/views/Tests/WizardBasicTest.php
index 1d7f2c833eca..516df720b150 100644
--- a/lib/Drupal/views/Tests/WizardBasicTest.php
+++ b/lib/Drupal/views/Tests/WizardBasicTest.php
@@ -34,7 +34,7 @@ function testViewsWizardAndListing() {
     $this->assertText(t('Your view was saved. You may edit it from the list below.'));
     $this->assertText($view1['human_name']);
     $this->assertText($view1['description']);
-    foreach(array('delete', 'clone', 'edit') as $operation) {
+    foreach (array('delete', 'clone', 'edit') as $operation) {
       $this->assertLinkByHref(url('admin/structure/views/view/' . $view1['name'] . '/' . $operation));
     }
 
diff --git a/lib/Drupal/views/View.php b/lib/Drupal/views/View.php
index 20de4b341176..8b4598befa3e 100644
--- a/lib/Drupal/views/View.php
+++ b/lib/Drupal/views/View.php
@@ -169,7 +169,7 @@ class View extends ViewsDbObject {
    *
    * @var views_plugin_style
    */
-   var $style_plugin;
+  var $style_plugin;
 
   /**
    * Stored the changed options of the style plugin.
@@ -988,7 +988,7 @@ function build($display_id = NULL) {
       $filter_groups = $this->display_handler->get_option('filter_groups');
       if ($filter_groups) {
         $this->query->set_group_operator($filter_groups['operator']);
-        foreach($filter_groups['groups'] as $id => $operator) {
+        foreach ($filter_groups['groups'] as $id => $operator) {
           $this->query->set_where_group($operator, $id);
         }
       }
@@ -1138,7 +1138,7 @@ function execute($display_id = NULL) {
       $cache = $this->display_handler->get_plugin('cache');
     }
     if ($cache && $cache->cache_get('results')) {
-      if($this->query->pager->use_pager()) {
+      if ($this->query->pager->use_pager()) {
         $this->query->pager->total_items = $this->total_rows;
         $this->query->pager->update_page_info();
       }
@@ -1554,9 +1554,9 @@ function get_title() {
    * The tokens in the title get's replaced before rendering.
    */
   function set_title($title) {
-     $this->build_info['title'] = $title;
-     return TRUE;
-   }
+    $this->build_info['title'] = $title;
+    return TRUE;
+  }
 
   /**
    * Return the human readable name for a view.
diff --git a/lib/Drupal/views/ViewsObject.php b/lib/Drupal/views/ViewsObject.php
index 141ec14dbfc5..ab2fd5d125c8 100644
--- a/lib/Drupal/views/ViewsObject.php
+++ b/lib/Drupal/views/ViewsObject.php
@@ -119,7 +119,7 @@ function unpack_options(&$storage, $options, $definition = NULL, $all = TRUE, $c
         $localization_keys = $this->localization_keys;
       }
       // but plugins don't because there isn't a common init() these days.
-      else if (!empty($this->is_plugin)) {
+      elseif (!empty($this->is_plugin)) {
         if ($this->plugin_type != 'display') {
           $localization_keys = array($this->view->current_display);
           $localization_keys[] = $this->plugin_type;
@@ -150,7 +150,7 @@ function unpack_options(&$storage, $options, $definition = NULL, $all = TRUE, $c
       }
       // Don't localize strings during editing. When editing, we need to work with
       // the original data, not the translated version.
-      else if (empty($this->view->editing) && !empty($definition[$key]['translatable']) && !empty($value) || !empty($definition['contains'][$key]['translatable']) && !empty($value)) {
+      elseif (empty($this->view->editing) && !empty($definition[$key]['translatable']) && !empty($value) || !empty($definition['contains'][$key]['translatable']) && !empty($value)) {
         if (!empty($this->view) && $this->view->is_translatable()) {
           // Allow other modules to make changes to the string before it's
           // sent for translation.
@@ -172,7 +172,7 @@ function unpack_options(&$storage, $options, $definition = NULL, $all = TRUE, $c
           $storage[$key] = t($value);
         }
       }
-      else if ($all || !empty($definition[$key])) {
+      elseif ($all || !empty($definition[$key])) {
         $storage[$key] = $value;
       }
     }
@@ -330,7 +330,7 @@ function unpack_translatable(&$translatable, $storage, $option, $definition, $pa
         if (is_array($value)) {
           $this->unpack_translatable($translatable, $options, $key, $definition, $parents, $translation_keys);
         }
-        else if (!empty($definition[$key]['translatable']) && !empty($value)) {
+        elseif (!empty($definition[$key]['translatable']) && !empty($value)) {
           // Build source data and add to the array
           $format = NULL;
           if (isset($definition['format_key']) && isset($options[$definition['format_key']])) {
@@ -344,7 +344,7 @@ function unpack_translatable(&$translatable, $storage, $option, $definition, $pa
         }
       }
     }
-    else if (!empty($definition['translatable']) && !empty($options)) {
+    elseif (!empty($definition['translatable']) && !empty($options)) {
       $value = $options;
       // Build source data and add to the array
       $format = NULL;
diff --git a/modules/comment.views_default.inc b/modules/comment.views_default.inc
index ada9abe80145..414f721bad19 100644
--- a/modules/comment.views_default.inc
+++ b/modules/comment.views_default.inc
@@ -6,7 +6,7 @@
  */
 
 /**
- * Implementation of hook_views_default_views()
+ * Implements hook_views_default_views().
  */
 function comment_views_default_views() {
   $views = array();
diff --git a/modules/comment/views_handler_field_comment.inc b/modules/comment/views_handler_field_comment.inc
index 7ca3256fa6db..cef33e5e2a1a 100644
--- a/modules/comment/views_handler_field_comment.inc
+++ b/modules/comment/views_handler_field_comment.inc
@@ -58,7 +58,7 @@ function render_link($data, $values) {
         $this->options['alter']['fragment'] = "comment-" . $cid;
       }
       // If there is no comment link to the node.
-      else if ($this->options['link_to_node']) {
+      elseif ($this->options['link_to_node']) {
         $this->options['alter']['path'] = "node/" . $nid;
       }
     }
diff --git a/modules/comment/views_handler_field_comment_link.inc b/modules/comment/views_handler_field_comment_link.inc
index 162924e166f7..11828aeab7ce 100644
--- a/modules/comment/views_handler_field_comment_link.inc
+++ b/modules/comment/views_handler_field_comment_link.inc
@@ -60,7 +60,7 @@ function render_link($data, $values) {
       $this->options['alter']['fragment'] = "comment-" . $cid;
     }
     // If there is no comment link to the node.
-    else if ($this->options['link_to_node']) {
+    elseif ($this->options['link_to_node']) {
       $this->options['alter']['path'] = "node/" . $nid;
     }
 
diff --git a/modules/statistics.views_default.inc b/modules/statistics.views_default.inc
index bbcccb63bf4d..1afb499a2172 100644
--- a/modules/statistics.views_default.inc
+++ b/modules/statistics.views_default.inc
@@ -6,7 +6,7 @@
  */
 
 /**
- * Implementation of hook_views_default_views()
+ * Implements of hook_views_default_views().
  */
 function statistics_views_default_views() {
   $views = array();
diff --git a/modules/taxonomy/views_handler_field_term_node_tid.inc b/modules/taxonomy/views_handler_field_term_node_tid.inc
index ca46c1d7bed5..7e3ad21ef98a 100644
--- a/modules/taxonomy/views_handler_field_term_node_tid.inc
+++ b/modules/taxonomy/views_handler_field_term_node_tid.inc
@@ -55,7 +55,7 @@ function options_form(&$form, &$form_state) {
     $form['limit'] = array(
       '#type' => 'checkbox',
       '#title' => t('Limit terms by vocabulary'),
-      '#default_value'=> $this->options['limit'],
+      '#default_value' => $this->options['limit'],
     );
 
     $options = array();
@@ -140,9 +140,9 @@ function document_self_tokens(&$tokens) {
   }
 
   function add_self_tokens(&$tokens, $item) {
-    foreach(array('tid', 'name', 'vocabulary_machine_name', 'vocabulary') as $token) {
+    foreach (array('tid', 'name', 'vocabulary_machine_name', 'vocabulary') as $token) {
       // Replace _ with - for the vocabulary machine name.
-      $tokens['[' . $this->options['id'] . '-' . str_replace('_', '-', $token). ']'] = isset($item[$token]) ? $item[$token] : '';
+      $tokens['[' . $this->options['id'] . '-' . str_replace('_', '-', $token) . ']'] = isset($item[$token]) ? $item[$token] : '';
     }
   }
 }
diff --git a/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc b/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc
index 7ffb595efe38..823b5612cb02 100644
--- a/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc
+++ b/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc
@@ -50,7 +50,7 @@ function options_form(&$form, &$form_state) {
     $form['limit'] = array(
       '#type' => 'checkbox',
       '#title' => t('Limit terms by vocabulary'),
-      '#default_value'=> $this->options['limit'],
+      '#default_value' => $this->options['limit'],
       '#states' => array(
         'visible' => array(
           ':input[name="options[argument_default][taxonomy_tid][node]"]' => array('checked' => TRUE),
@@ -80,7 +80,7 @@ function options_form(&$form, &$form_state) {
     $form['anyall'] = array(
       '#type' => 'radios',
       '#title' => t('Multiple-value handling'),
-      '#default_value'=> $this->options['anyall'],
+      '#default_value' => $this->options['anyall'],
       '#process' => array('form_process_radios', 'ctools_dependent_process'),
       '#options' => array(
         ',' => t('Filter to items that share all terms'),
diff --git a/plugins/views_plugin_cache.inc b/plugins/views_plugin_cache.inc
index b5a227ba2b9c..01c4fec215e8 100644
--- a/plugins/views_plugin_cache.inc
+++ b/plugins/views_plugin_cache.inc
@@ -80,7 +80,7 @@ function summary_title() {
    * @param $type
    *   The cache type, either 'query', 'result' or 'output'.
    */
-   function cache_expire($type) { }
+  function cache_expire($type) { }
 
    /**
     * Determine expiration time in the cache table of the cache type
@@ -270,7 +270,7 @@ function get_results_key() {
 
       $query_plugin = $this->view->display_handler->get_plugin('query');
 
-      foreach (array('query','count_query') as $index) {
+      foreach (array('query', 'count_query') as $index) {
         // If the default query back-end is used generate SQL query strings from
         // the query objects.
         if ($build_info[$index] instanceof Drupal\Core\Database\Query\Select) {
diff --git a/plugins/views_plugin_display_attachment.inc b/plugins/views_plugin_display_attachment.inc
index 91c8d1f9436a..e350a24ab2ba 100644
--- a/plugins/views_plugin_display_attachment.inc
+++ b/plugins/views_plugin_display_attachment.inc
@@ -15,7 +15,7 @@
  * @ingroup views_display_plugins
  */
 class views_plugin_display_attachment extends views_plugin_display {
-  function option_definition () {
+  function option_definition() {
     $options = parent::option_definition();
 
     $options['displays'] = array('default' => array());
diff --git a/plugins/views_plugin_display_block.inc b/plugins/views_plugin_display_block.inc
index c903a9b66871..c029dd353014 100644
--- a/plugins/views_plugin_display_block.inc
+++ b/plugins/views_plugin_display_block.inc
@@ -235,7 +235,7 @@ function save_block_cache($delta, $cache_setting) {
         ->fields(array(
         'cache' => $cache_setting,
         ))
-        ->condition('module','views')
+        ->condition('module', 'views')
         ->condition('delta', $delta)
         ->execute();
     }
diff --git a/plugins/views_plugin_display_feed.inc b/plugins/views_plugin_display_feed.inc
index c8101bad92f9..5355f24e9ba2 100644
--- a/plugins/views_plugin_display_feed.inc
+++ b/plugins/views_plugin_display_feed.inc
@@ -63,7 +63,7 @@ function render() {
   }
 
   function defaultable_sections($section = NULL) {
-    if (in_array($section, array('style_options', 'style_plugin', 'row_options', 'row_plugin',))) {
+    if (in_array($section, array('style_options', 'style_plugin', 'row_options', 'row_plugin'))) {
       return FALSE;
     }
 
diff --git a/plugins/views_plugin_display_page.inc b/plugins/views_plugin_display_page.inc
index 2a6e80dc2294..a713c64dd123 100644
--- a/plugins/views_plugin_display_page.inc
+++ b/plugins/views_plugin_display_page.inc
@@ -30,7 +30,7 @@ function option_definition() {
         'weight' => array('default' => 0),
         'name' => array('default' => variable_get('menu_default_node_menu', 'navigation')),
         'context' => array('default' => ''),
-       ),
+      ),
     );
     $options['tab_options'] = array(
       'contains' => array(
@@ -40,7 +40,7 @@ function option_definition() {
         'description' => array('default' => '', 'translatable' => FALSE),
         'weight' => array('default' => 0),
         'name' => array('default' => 'navigation'),
-       ),
+      ),
     );
 
     return $options;
@@ -266,7 +266,7 @@ function options_summary(&$categories, &$options) {
     if (!is_array($menu)) {
       $menu = array('type' => 'none');
     }
-    switch($menu['type']) {
+    switch ($menu['type']) {
       case 'none':
       default:
         $menu_str = t('No menu');
@@ -311,7 +311,7 @@ function options_form(&$form, &$form_state) {
           '#default_value' => $this->get_option('path'),
           '#field_prefix' => '<span dir="ltr">' . url(NULL, array('absolute' => TRUE)),
           '#field_suffix' => '</span>&lrm;',
-          '#attributes' => array('dir'=>'ltr'),
+          '#attributes' => array('dir' => 'ltr'),
         );
         break;
       case 'menu':
diff --git a/plugins/views_plugin_exposed_form.inc b/plugins/views_plugin_exposed_form.inc
index 8ba59197278a..c8468f131fab 100644
--- a/plugins/views_plugin_exposed_form.inc
+++ b/plugins/views_plugin_exposed_form.inc
@@ -58,7 +58,7 @@ function options_form(&$form, &$form_state) {
       '#required' => TRUE,
     );
 
-    $form['reset_button'] = array (
+    $form['reset_button'] = array(
       '#type' => 'checkbox',
       '#title' => t('Include reset button'),
       '#description' => t('If checked the exposed form will provide a button to reset all the applied exposed filters'),
@@ -176,7 +176,7 @@ function query() {
           if (!$sort->is_exposed()) {
             $sort->query();
           }
-          else if ($key == $sort_by) {
+          elseif ($key == $sort_by) {
             if (isset($exposed_data['sort_order']) && in_array($exposed_data['sort_order'], array('ASC', 'DESC'))) {
               $sort->options['order'] = $exposed_data['sort_order'];
             }
@@ -225,7 +225,8 @@ function exposed_form_alter(&$form, &$form_state) {
       );
       if (isset($form_state['input']['sort_by']) && isset($this->view->sort[$form_state['input']['sort_by']])) {
         $default_sort_order = $this->view->sort[$form_state['input']['sort_by']]->options['order'];
-      } else {
+      }
+      else {
         $first_sort = reset($this->view->sort);
         $default_sort_order = $first_sort->options['order'];
       }
diff --git a/plugins/views_plugin_pager_full.inc b/plugins/views_plugin_pager_full.inc
index dc3072a39615..a84463371feb 100644
--- a/plugins/views_plugin_pager_full.inc
+++ b/plugins/views_plugin_pager_full.inc
@@ -90,7 +90,7 @@ function options_form(&$form, &$form_state) {
       '#default_value' => $this->options['quantity'],
     );
 
-    $form['tags'] = array (
+    $form['tags'] = array(
       '#type' => 'fieldset',
       '#collapsible' => FALSE,
       '#collapsed' => FALSE,
@@ -128,7 +128,7 @@ function options_form(&$form, &$form_state) {
       '#default_value' => $this->options['tags']['last'],
     );
 
-    $form['expose'] = array (
+    $form['expose'] = array(
       '#type' => 'fieldset',
       '#collapsible' => FALSE,
       '#collapsed' => FALSE,
@@ -219,7 +219,7 @@ function options_validate(&$form, &$form_state) {
     if (strpos($exposed_options, '.') !== FALSE) {
       $error = TRUE;
     }
-    $options = explode(',',$exposed_options);
+    $options = explode(',', $exposed_options);
     if (!$error && is_array($options)) {
       foreach ($options as $option) {
         if (!is_numeric($option) || intval($option) == 0) {
@@ -366,7 +366,7 @@ function update_page_info() {
       if ($this->current_page < 0) {
         $this->current_page = 0;
       }
-      else if ($this->current_page >= $pager_total[$this->options['id']]) {
+      elseif ($this->current_page >= $pager_total[$this->options['id']]) {
         // Pages are numbered from 0 so if there are 10 pages, the last page is 9.
         $this->current_page = $pager_total[$this->options['id']] - 1;
       }
diff --git a/plugins/views_plugin_query_default.inc b/plugins/views_plugin_query_default.inc
index 3fd3f01be756..9398a96427c0 100644
--- a/plugins/views_plugin_query_default.inc
+++ b/plugins/views_plugin_query_default.inc
@@ -89,17 +89,17 @@ class views_plugin_query_default extends views_plugin_query {
    *
    * @var views_plugin_pager
    */
-   var $pager = NULL;
+  var $pager = NULL;
 
    /**
     * An array mapping table aliases and field names to field aliases.
     */
-   var $field_aliases = array();
+  var $field_aliases = array();
 
    /**
     * Query tags which will be passed over to the dbtng query object.
     */
-   var $tags = array();
+  var $tags = array();
 
   /**
    * Is the view marked as not distinct.
@@ -1044,8 +1044,8 @@ function add_orderby($table, $field = NULL, $order = 'ASC', $alias = '', $params
       'direction' => strtoupper($order)
     );
 
-	/**
- 	 * -- removing, this should be taken care of by field adding now.
+    /**
+     * -- removing, this should be taken care of by field adding now.
      * -- leaving commented because I am unsure.
       // If grouping, all items in the order by must also be in the
       // group by clause. Check $table to ensure that this is not a
@@ -1053,7 +1053,7 @@ function add_orderby($table, $field = NULL, $order = 'ASC', $alias = '', $params
       if ($this->groupby && $table) {
         $this->add_groupby($as);
       }
-    */
+     */
   }
 
   /**
@@ -1243,7 +1243,7 @@ function compile_fields($fields_array, $query) {
   function query($get_count = FALSE) {
     // Check query distinct value.
     if (empty($this->no_distinct) && $this->distinct && !empty($this->fields)) {
-      if ($this->pure_distinct === FALSE){
+      if ($this->pure_distinct === FALSE) {
         $base_field_alias = $this->add_field($this->base_table, $this->base_field);
         $this->add_groupby($base_field_alias);
       }
diff --git a/plugins/views_wizard/views_ui_base_views_wizard.class.php b/plugins/views_wizard/views_ui_base_views_wizard.class.php
index e8eba23eb39b..ca6ba079234c 100644
--- a/plugins/views_wizard/views_ui_base_views_wizard.class.php
+++ b/plugins/views_wizard/views_ui_base_views_wizard.class.php
@@ -89,7 +89,7 @@ function build_form($form, &$form_state) {
 
     $form['displays']['page'] = array(
       '#type' => 'fieldset',
-      '#attributes' => array('class' => array('views-attachment', 'fieldset-no-legend'),),
+      '#attributes' => array('class' => array('views-attachment', 'fieldset-no-legend')),
       '#tree' => TRUE,
     );
     $form['displays']['page']['create'] = array(
@@ -104,7 +104,7 @@ function build_form($form, &$form_state) {
     // can be hidden en masse when the "Create a page" checkbox is unchecked.
     $form['displays']['page']['options'] = array(
       '#type' => 'container',
-      '#attributes' => array('class' => array('options-set'),),
+      '#attributes' => array('class' => array('options-set')),
       '#states' => array(
         'visible' => array(
           ':input[name="page[create]"]' => array('checked' => TRUE),
@@ -232,7 +232,7 @@ function build_form($form, &$form_state) {
 
     $form['displays']['block'] = array(
       '#type' => 'fieldset',
-      '#attributes' => array('class' => array('views-attachment', 'fieldset-no-legend'),),
+      '#attributes' => array('class' => array('views-attachment', 'fieldset-no-legend')),
       '#tree' => TRUE,
     );
     $form['displays']['block']['create'] = array(
@@ -246,7 +246,7 @@ function build_form($form, &$form_state) {
     // can be hidden en masse when the "Create a block" checkbox is unchecked.
     $form['displays']['block']['options'] = array(
       '#type' => 'container',
-      '#attributes' => array('class' => array('options-set'),),
+      '#attributes' => array('class' => array('options-set')),
       '#states' => array(
         'visible' => array(
           ':input[name="block[create]"]' => array('checked' => TRUE),
@@ -928,12 +928,12 @@ function validate($form, &$form_state) {
    *
    * @throws ViewsWizardException if the values have not been validated.
    */
- function create_view($form, &$form_state) {
+  function create_view($form, &$form_state) {
    $view = $this->retrieve_validated_view($form, $form_state);
-   if (empty($view)) {
-     throw new ViewsWizardException(t('Attempted to create_view with values that have not been validated'));
-   }
-   return $view;
- }
+    if (empty($view)) {
+      throw new ViewsWizardException(t('Attempted to create_view with values that have not been validated'));
+    }
+    return $view;
+  }
 
 }
diff --git a/theme/views-ui-display-tab-bucket.tpl.php b/theme/views-ui-display-tab-bucket.tpl.php
index 5731328cdb2b..5bc3aa0a8bec 100644
--- a/theme/views-ui-display-tab-bucket.tpl.php
+++ b/theme/views-ui-display-tab-bucket.tpl.php
@@ -7,7 +7,7 @@
 ?>
 <div <?php print $attributes; ?>>
   <?php print $item_help_icon; ?>
-  <?php if(!empty($actions)) : ?>
+  <?php if (!empty($actions)) : ?>
     <?php print $actions; ?>
   <?php endif; ?>
   <?php if (!empty($title)) : ?>
diff --git a/views.module b/views.module
index e18e8a8416cb..171c3821c688 100644
--- a/views.module
+++ b/views.module
@@ -1708,7 +1708,7 @@ function views_debug($message, $placeholders = array()) {
       $output = $message;
       watchdog('views_logging', $output, $placeholders);
     }
-    else if ($devel_region == 'drupal_debug') {
+    elseif ($devel_region == 'drupal_debug') {
       $output = empty($output) ? t($message, $placeholders) : $output;
       dd($output);
     }
-- 
GitLab