From 6030acbef8b7864624b7ff55f263b06c569d5fca Fri, 24 Jun 2011 20:28:09 +0200
From: casey <caseynotane@live.com>
Date: Fri, 24 Jun 2011 20:27:20 +0200
Subject: [PATCH] typehints plus obsolete reference-indicators

diff --git a/docs/views.api.php b/docs/views.api.php
index 393dc34..70b5e65 100644
--- a/docs/views.api.php
+++ b/docs/views.api.php
@@ -587,7 +587,7 @@
  * Adding output to the view can be accomplished by placing text on
  * $view->attachment_before and $view->attachment_after.
  */
-function hook_views_pre_view(&$view, &$display_id, &$args) {
+function hook_views_pre_view(view $view, $display_id, &$args) {
   // example code here
 }
 
@@ -598,7 +598,7 @@
  * Adding output to the view can be accomplished by placing text on
  * $view->attachment_before and $view->attachment_after.
  */
-function hook_views_pre_build(&$view) {
+function hook_views_pre_build(view $view) {
   // example code here
 }
 
@@ -609,7 +609,7 @@
  * Adding output to the view can be accomplished by placing text on
  * $view->attachment_before and $view->attachment_after.
  */
-function hook_views_post_build(&$view) {
+function hook_views_post_build(view $view) {
   // example code here
 }
 
@@ -620,7 +620,7 @@
  * Adding output to the view can be accomplished by placing text on
  * $view->attachment_before and $view->attachment_after.
  */
-function hook_views_pre_execute(&$view) {
+function hook_views_pre_execute(view $view) {
   // example code here
 }
 
@@ -633,7 +633,7 @@
  * $view->attachment_before and $view->attachment_after. Altering the
  * content can be achieved by editing the items of $view->result.
  */
-function hook_views_post_execute(&$view) {
+function hook_views_post_execute(view $view) {
   // example code here
 }
 
@@ -648,7 +648,7 @@
  *
  * This hook can be utilized by themes.
  */
-function hook_views_pre_render(&$view) {
+function hook_views_pre_render(view $view) {
   // example code here
 }
 
@@ -674,7 +674,7 @@
  *
  * This hook can be utilized by themes.
  */
-function hook_views_post_render(&$view, &$output, &$cache) {
+function hook_views_post_render(view $view, &$output, &$cache) {
 
 }
 
@@ -687,7 +687,7 @@
  * file, if 'path' is unspecified.
  *
  */
-function hook_views_query_alter(&$view, &$query) {
+function hook_views_query_alter(view $view, view_plugin_query $query) {
   // example code here
 }
 
@@ -709,7 +709,7 @@
  *
  * @see theme_table
  */
-function hook_views_preview_info_alter(&$rows, $view) {
+function hook_views_preview_info_alter(&$rows, view $view) {
   // example code here
 }
 
@@ -724,7 +724,7 @@
  * @param $display_id
  *   The current display id which is edited. For example that's 'default' or 'page_1'.
  */
-function hook_views_ui_display_top_links_alter(&$links, $view, $display_id) {
+function hook_views_ui_display_top_links_alter(&$links, view $view, $display_id) {
   // example code here
 }
 
diff --git a/drush/views.drush.inc b/drush/views.drush.inc
index 04c96aa..aaafc90 100644
--- a/drush/views.drush.inc
+++ b/drush/views.drush.inc
@@ -176,7 +176,7 @@
  * Checks on wether or not the view is overridden is handled in views_revert_views_revert()
  * We perform a check here anyway in case someone somehow calls this function on their own...
  */
-function views_revert_view($view) {
+function views_revert_view(view $view) {
   // check anyway just in case
   if ($view->type == t('Overridden')) {
     // Revert the view.
diff --git a/handlers/views_handler_argument.inc b/handlers/views_handler_argument.inc
index e589542..70c2f53 100644
--- a/handlers/views_handler_argument.inc
+++ b/handlers/views_handler_argument.inc
@@ -47,7 +47,7 @@
     }
   }
 
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
 
     // Compatibility: The new UI changed several settings.
@@ -648,7 +648,7 @@
     }
 
     if (!empty($info['method args'])) {
-      return call_user_func_array(array(&$this, $info['method']), $info['method args']);
+      return call_user_func_array(array($this, $info['method']), $info['method args']);
     }
     else {
       return $this->{$info['method']}();
diff --git a/handlers/views_handler_argument_many_to_one.inc b/handlers/views_handler_argument_many_to_one.inc
index 1f5229e..708d728 100644
--- a/handlers/views_handler_argument_many_to_one.inc
+++ b/handlers/views_handler_argument_many_to_one.inc
@@ -13,7 +13,7 @@
  * @ingroup views_argument_handlers
  */
 class views_handler_argument_many_to_one extends views_handler_argument {
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
     $this->helper = new views_many_to_one_helper($this);
 
diff --git a/handlers/views_handler_argument_string.inc b/handlers/views_handler_argument_string.inc
index 7e86eb1..6d0d37c 100644
--- a/handlers/views_handler_argument_string.inc
+++ b/handlers/views_handler_argument_string.inc
@@ -7,7 +7,7 @@
  * @ingroup views_argument_handlers
  */
 class views_handler_argument_string extends views_handler_argument {
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
     if (!empty($this->definition['many to one'])) {
       $this->helper = new views_many_to_one_helper($this);
diff --git a/handlers/views_handler_field.inc b/handlers/views_handler_field.inc
index a62ac79..d3b1457 100644
--- a/handlers/views_handler_field.inc
+++ b/handlers/views_handler_field.inc
@@ -47,7 +47,7 @@
     return TRUE;
   }
 
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
 
     $this->options += array(
diff --git a/handlers/views_handler_field_boolean.inc b/handlers/views_handler_field_boolean.inc
index aec5243..6075dd6 100644
--- a/handlers/views_handler_field_boolean.inc
+++ b/handlers/views_handler_field_boolean.inc
@@ -25,7 +25,7 @@
     return $options;
   }
 
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
 
     $default_formats = array(
diff --git a/handlers/views_handler_filter.inc b/handlers/views_handler_filter.inc
index 541e5df..8edf084 100644
--- a/handlers/views_handler_filter.inc
+++ b/handlers/views_handler_filter.inc
@@ -30,7 +30,7 @@
    * This likely has to be overridden by filters which are more complex
    * than simple operator/value.
    */
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
 
     $this->operator = $this->options['operator'];
diff --git a/handlers/views_handler_filter_many_to_one.inc b/handlers/views_handler_filter_many_to_one.inc
index 58fb0d0..6f04b02 100644
--- a/handlers/views_handler_filter_many_to_one.inc
+++ b/handlers/views_handler_filter_many_to_one.inc
@@ -9,7 +9,7 @@
  * to provide something that isn't just a select list.
  */
 class views_handler_filter_many_to_one extends views_handler_filter_in_operator {
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
     $this->helper = new views_many_to_one_helper($this);
   }
diff --git a/handlers/views_handler_relationship.inc b/handlers/views_handler_relationship.inc
index 341350b..2b9c0e7 100644
--- a/handlers/views_handler_relationship.inc
+++ b/handlers/views_handler_relationship.inc
@@ -37,7 +37,7 @@
    * Init handler to let relationships live on tables other than
    * the table they operate on.
    */
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
     if (isset($this->definition['relationship table'])) {
       $this->table = $this->definition['relationship table'];
diff --git a/handlers/views_handler_sort_group_by_numeric.inc b/handlers/views_handler_sort_group_by_numeric.inc
index 61b3409..5d75b95 100644
--- a/handlers/views_handler_sort_group_by_numeric.inc
+++ b/handlers/views_handler_sort_group_by_numeric.inc
@@ -3,7 +3,7 @@
  * Handler for GROUP BY on simple numeric fields.
  */
 class views_handler_sort_group_by_numeric extends views_handler_sort {
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
 
     // Initialize the original handler.
diff --git a/help/get-total-rows.html b/help/get-total-rows.html
index 3e74fd9..4a123d6 100644
--- a/help/get-total-rows.html
+++ b/help/get-total-rows.html
@@ -7,7 +7,7 @@
 
 <pre>
 &lt;?php
-function my_module_views_pre_execute(&$view) {
+function my_module_views_pre_execute(view $view) {
   if ($view->name == 'my_view' && $view->current_display == 'my_display') {
     $view->get_total_rows = TRUE;
   }
diff --git a/includes/admin.inc b/includes/admin.inc
index 1cf5459..e046d76 100644
--- a/includes/admin.inc
+++ b/includes/admin.inc
@@ -84,7 +84,7 @@
 /**
  * Returns the results of the live preview.
  */
-function views_ui_preview($view, $display_id, $args = array()) {
+function views_ui_preview(view $view, $display_id, $args = array()) {
   // When this function is invoked as a page callback, each Views argument is
   // passed separately.
   if (!is_array($args)) {
@@ -812,8 +812,8 @@
 /**
  * Page to delete a view.
  */
-function views_ui_break_lock_confirm($form, &$form_state, $view) {
-  $form_state['view'] = &$view;
+function views_ui_break_lock_confirm($form, &$form_state, view $view) {
+  $form_state['view'] = $view;
   $form = array();
 
   if (empty($view->locked)) {
@@ -849,7 +849,7 @@
  *
  * This function handles access to the display.
  */
-function views_ui_edit_page_display($view, $display_id) {
+function views_ui_edit_page_display(view $view, $display_id) {
   // Determine the displays available for editing.
   if ($tabs = views_ui_edit_page_display_tabs($view)) {
     // If a display isn't specified, use the first one.
@@ -882,7 +882,7 @@
 /**
  * Page callback for the Edit View page.
  */
-function views_ui_edit_page($view, $display_id = NULL) {
+function views_ui_edit_page(view $view, $display_id = NULL) {
   $display_id = views_ui_edit_page_display($view, $display_id);
   if (!in_array($display_id, array(MENU_ACCESS_DENIED, MENU_NOT_FOUND))) {
     $build = array();
@@ -896,7 +896,7 @@
   return $build;
 }
 
-function views_ui_build_preview($view, $display_id) {
+function views_ui_build_preview(view $view, $display_id) {
   if (isset($_POST['ajax_html_ids'])) {
     unset($_POST['ajax_html_ids']);
   }
@@ -932,7 +932,7 @@
  * @todo Rename to views_ui_edit_view_form(). See that function for the "old"
  *   version.
  */
-function views_ui_edit_form($form, &$form_state, $view, $display_id = NULL) {
+function views_ui_edit_form($form, &$form_state, view $view, $display_id = NULL) {
   // Do not allow the form to be cached, because $form_state['view'] can become
   // stale between page requests.
   // @see views_ui_ajax_get_form() for how this affects #ajax.
@@ -1131,7 +1131,7 @@
 /**
  * Provide the preview formulas and the preview output, too.
  */
-function views_ui_preview_form($form, &$form_state, $view, $display_id = 'default') {
+function views_ui_preview_form($form, &$form_state, view $view, $display_id = 'default') {
   $form_state['no_cache'] = TRUE;
   $form_state['view'] = $view;
 
@@ -1184,7 +1184,7 @@
 /**
  * Render the top of the display so it can be updated during ajax operations.
  */
-function views_ui_render_display_top($view, $display_id) {
+function views_ui_render_display_top(view $view, $display_id) {
   $element['#theme_wrappers'] = array('views_container');
   $element['#attributes']['class'] = array('views-display-top');
   $element['#attributes']['id'] = array('views-display-top');
@@ -1415,7 +1415,7 @@
  * having them as secondary local tasks isn't desired. The caller is responsible
  * for setting the active tab's #active property to TRUE.
  */
-function views_ui_edit_page_display_tabs($view) {
+function views_ui_edit_page_display_tabs(view $view) {
   $tabs = array();
 
   // Create a tab for each display.
@@ -1447,7 +1447,7 @@
 /**
  * Controls whether or not the default display should have its own tab on edit.
  */
-function views_ui_show_default_display($view) {
+function views_ui_show_default_display(view $view) {
   // Always show the default display for advanced users who prefer that mode.
   $advanced_mode = variable_get('views_ui_show_master_display', FALSE);
   // For other users, show the default display only if there are no others, and
@@ -1460,7 +1460,7 @@
 /**
  * Returns a renderable array representing the edit page for one display.
  */
-function views_ui_get_display_tab($view, $display_id) {
+function views_ui_get_display_tab(view $view, $display_id) {
   $build = array();
   $display = $view->display[$display_id];
   $plugin = $display->handler->definition;
@@ -1490,7 +1490,7 @@
  * @return array
  *   A renderable page build array.
  */
-function views_ui_get_display_tab_details($view, $display) {
+function views_ui_get_display_tab_details(view $view, views_plugin_display $display) {
   $display_title = views_ui_get_display_label($view, $display->id, FALSE);
   $build = array(
     '#theme_wrappers' => array('container'),
@@ -1697,7 +1697,7 @@
  * This function might be more logical as a method on an object, if a suitable
  * object emerges out of refactoring.
  */
-function views_ui_edit_form_get_build_from_option($id, $option, $view, $display) {
+function views_ui_edit_form_get_build_from_option($id, $option, view $view, views_plugin_display $display) {
   $option_build = array();
   $option_build['#theme'] = 'views_ui_display_tab_setting';
 
@@ -2012,7 +2012,7 @@
     form_set_error('', t('Unable to import view.'));
   }
 
-  $form_state['view'] = &$view;
+  $form_state['view'] = $view;
 }
 
 /**
@@ -2098,7 +2098,7 @@
 /**
  * Add information about a section to a display.
  */
-function views_ui_edit_form_get_bucket($type, $view, $display) {
+function views_ui_edit_form_get_bucket($type, view $view, views_plugin_display $display) {
   $build = array(
     '#theme_wrappers' => array('views_ui_display_tab_bucket'),
   );
@@ -2294,7 +2294,7 @@
 /**
  * Regenerate the current tab for AJAX updates.
  */
-function views_ui_regenerate_tab(&$view, &$output, $display_id) {
+function views_ui_regenerate_tab(view $view, &$output, $display_id) {
   if (!$view->set_display('default')) {
     return;
   }
@@ -2484,7 +2484,7 @@
   elseif ($was_defaulted && !$is_defaulted) {
     // We were using the default display's values, but we're now overriding
     // the default display and saving values specific to this display.
-    $display = &$form_state['view']->display[$form_state['display_id']];
+    $display = $form_state['view']->display[$form_state['display_id']];
     $display->handler->options_override($form, $form_state);
     $display->handler->options_submit($form, $form_state);
   }
@@ -2493,7 +2493,7 @@
     // to go back to the default display.
     // Overwrite the default display with the current form values, and make
     // the current display use the new default values.
-    $display = &$form_state['view']->display[$form_state['display_id']];
+    $display = $form_state['view']->display[$form_state['display_id']];
     $display->handler->options_override($form, $form_state);
     $display->handler->options_submit($form, $form_state);
   }
@@ -2522,7 +2522,7 @@
  * the current display.
  */
 function views_ui_standard_display_dropdown(&$form, &$form_state, $section) {
-  $view = &$form_state['view'];
+  $view = $form_state['view'];
   $display_id = $form_state['display_id'];
   $displays = $view->display;
   $current_display = $view->display[$display_id];
@@ -2585,7 +2585,7 @@
  *   - current: The number of the current form on the stack.
  *   - total: The total number of forms originally on the stack.
  */
-function views_ui_get_form_progress($view) {
+function views_ui_get_form_progress(view $view) {
   $progress = FALSE;
   if (!empty($view->stack)) {
     $stack = $view->stack;
@@ -2677,7 +2677,7 @@
  * is the same as another. Since the arguments differ slightly
  * we do a lot of spiffy concatenation here.
  */
-function views_ui_build_identifier($key, $view, $display_id, $args) {
+function views_ui_build_identifier($key, view $view, $display_id, $args) {
   $form = views_ui_ajax_forms($key);
   // Automatically remove the single-form cache if it exists and
   // does not match the key.
@@ -2694,13 +2694,13 @@
  * Build up a $form_state object suitable for use with drupal_build_form
  * based on known information about a form.
  */
-function views_ui_build_form_state($js, $key, &$view, $display_id, $args) {
+function views_ui_build_form_state($js, $key, view $view, $display_id, $args) {
   $form = views_ui_ajax_forms($key);
   // Build up form state
   $form_state = array(
     'form_key' => $key,
     'form_id' => $form['form_id'],
-    'view' => &$view,
+    'view' => $view,
     'ajax' => $js,
     'display_id' => $display_id,
     'no_redirect' => TRUE,
@@ -2732,12 +2732,12 @@
  * Add another form to the stack; clicking 'apply' will go to this form
  * rather than closing the ajax popup.
  */
-function views_ui_add_form_to_stack($key, &$view, $display_id, $args, $top = FALSE) {
+function views_ui_add_form_to_stack($key, view $view, $display_id, $args, $top = FALSE) {
   if (empty($view->stack)) {
     $view->stack = array();
   }
 
-  $stack = array(views_ui_build_identifier($key, $view, $display_id, $args), $key, &$view, $display_id, $args);
+  $stack = array(views_ui_build_identifier($key, $view, $display_id, $args), $key, $view, $display_id, $args);
   // If we're being asked to add this form to the bottom of the stack, no
   // special logic is required. Our work is equally easy if we were asked to add
   // to the top of the stack, but there's nothing in it yet.
@@ -2771,7 +2771,7 @@
  * We do this for consistency and to make it easy to chain forms
  * together.
  */
-function views_ui_ajax_form($js, $key, $view, $display_id = '') {
+function views_ui_ajax_form($js, $key, view $view, $display_id = '') {
   // Reset the cache of IDs. Drupal rather aggressively prevents id duplication
   // but this causes it to remember IDs that are no longer even being used.
   if (isset($_POST['ajax_html_ids'])) {
@@ -2875,7 +2875,7 @@
  * Form constructor callback to display analysis information on a view
  */
 function views_ui_analyze_view_form($form, &$form_state) {
-  $view = &$form_state['view'];
+  $view = $form_state['view'];
 
   $form['#title'] = t('View analysis');
   $form['#section'] = 'analyze';
@@ -2906,7 +2906,7 @@
  * Form constructor callback to reorder displays on a view
  */
 function views_ui_reorder_displays_form($form, &$form_state) {
-  $view = &$form_state['view'];
+  $view = $form_state['view'];
   $display_id = $form_state['display_id'];
 
   $form['view'] = array('#type' => 'value', '#value' => $view);
@@ -3081,7 +3081,7 @@
  * Form builder to edit details of a view.
  */
 function views_ui_edit_details_form($form, &$form_state) {
-  $view = &$form_state['view'];
+  $view = $form_state['view'];
 
   $form['#title'] = t('View name and description');
   $form['#section'] = 'details';
@@ -3134,14 +3134,14 @@
  * Form constructor callback to edit display of a view
  */
 function views_ui_edit_display_form($form, &$form_state) {
-  $view = &$form_state['view'];
+  $view = $form_state['view'];
   $display_id = $form_state['display_id'];
   $section = $form_state['section'];
 
   if (!$view->set_display($display_id)) {
     views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
   }
-  $display = &$view->display[$display_id];
+  $display = $view->display[$display_id];
 
   // Get form from the handler.
   $form['options'] = array(
@@ -3174,7 +3174,7 @@
  * Validate handler for views_ui_edit_display_form
  */
 function views_ui_edit_display_form_validate($form, &$form_state) {
-  $display = &$form_state['view']->display[$form_state['display_id']];
+  $display = $form_state['view']->display[$form_state['display_id']];
   $display->handler->options_validate($form, $form_state);
 
   if (form_get_errors()) {
@@ -3186,7 +3186,7 @@
  * Submit handler for views_ui_edit_display_form
  */
 function views_ui_edit_display_form_submit($form, &$form_state) {
-  $display = &$form_state['view']->display[$form_state['display_id']];
+  $display = $form_state['view']->display[$form_state['display_id']];
   $display->handler->options_submit($form, $form_state);
 
   views_ui_cache_set($form_state['view']);
@@ -3198,7 +3198,7 @@
  * @TODO: Not currently used. Remove unless we implement an override toggle.
  */
 function views_ui_edit_display_form_override($form, &$form_state) {
-  $display = &$form_state['view']->display[$form_state['display_id']];
+  $display = $form_state['view']->display[$form_state['display_id']];
   $display->handler->options_override($form, $form_state);
 
   views_ui_cache_set($form_state['view']);
@@ -3210,7 +3210,7 @@
  * Form to config items in the views UI.
  */
 function views_ui_config_type_form($form, &$form_state) {
-  $view = &$form_state['view'];
+  $view = $form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
 
@@ -3218,7 +3218,7 @@
   if (!$view->set_display($display_id)) {
     views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
   }
-  $display = &$view->display[$display_id];
+  $display = $view->display[$display_id];
   $form['#title'] = t('Configure @type', array('@type' => $types[$type]['ltitle']));
   $form['#section'] = $display_id . 'config-item';
 
@@ -3247,7 +3247,7 @@
  */
 function views_ui_config_type_form_submit($form, &$form_state) {
   $types = views_object_types();
-  $display = &$form_state['view']->display[$form_state['display_id']];
+  $display = $form_state['view']->display[$form_state['display_id']];
 
   // Store in cache
   views_ui_cache_set($form_state['view']);
@@ -3257,7 +3257,7 @@
  * Form to rearrange items in the views UI.
  */
 function views_ui_rearrange_form($form, &$form_state) {
-  $view = &$form_state['view'];
+  $view = $form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
 
@@ -3265,7 +3265,7 @@
   if (!$view->set_display($display_id)) {
     views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
   }
-  $display = &$view->display[$display_id];
+  $display = $view->display[$display_id];
   $form['#title'] = t('Rearrange @type', array('@type' => $types[$type]['ltitle']));
   $form['#section'] = $display_id . 'rearrange-item';
 
@@ -3422,7 +3422,7 @@
  */
 function views_ui_rearrange_form_submit($form, &$form_state) {
   $types = views_object_types();
-  $display = &$form_state['view']->display[$form_state['display_id']];
+  $display = $form_state['view']->display[$form_state['display_id']];
 
   $old_fields = $display->handler->get_option($types[$form_state['type']]['plural']);
   $new_fields = $order = array();
@@ -3453,7 +3453,7 @@
  * Form to rearrange items in the views UI.
  */
 function views_ui_rearrange_filter_form($form, &$form_state) {
-  $view = &$form_state['view'];
+  $view = $form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
 
@@ -3461,7 +3461,7 @@
   if (!$view->set_display($display_id)) {
     views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
   }
-  $display = &$view->display[$display_id];
+  $display = $view->display[$display_id];
   $form['#title'] = check_plain($display->display_title) . ': ';
   $form['#title'] .= t('Rearrange @type', array('@type' => $types[$type]['ltitle']));
   $form['#section'] = $display_id . 'rearrange-item';
@@ -3724,7 +3724,7 @@
  */
 function views_ui_rearrange_filter_form_submit($form, &$form_state) {
   $types = views_object_types();
-  $display = &$form_state['view']->display[$form_state['display_id']];
+  $display = $form_state['view']->display[$form_state['display_id']];
   $remember_groups = array();
 
   if (!empty($form_state['view']->form_cache)) {
@@ -3830,7 +3830,7 @@
  * Form to add_item items in the views UI.
  */
 function views_ui_add_item_form($form, &$form_state) {
-  $view = &$form_state['view'];
+  $view = $form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
 
@@ -3846,7 +3846,7 @@
   if (!$view->set_display($display_id)) {
     views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
   }
-  $display = &$view->display[$display_id];
+  $display = $view->display[$display_id];
 
   $types = views_object_types();
   $ltitle = $types[$type]['ltitle'];
@@ -3997,7 +3997,7 @@
  * Form to config_item items in the views UI.
  */
 function views_ui_config_item_form($form, &$form_state) {
-  $view = &$form_state['view'];
+  $view = $form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
   $id = $form_state['id'];
@@ -4104,7 +4104,7 @@
 
       // Get form from the handler.
       $handler->options_form($form['options'], $form_state);
-      $form_state['handler'] = &$handler;
+      $form_state['handler'] = $handler;
     }
 
     $name = NULL;
@@ -4240,7 +4240,7 @@
  * Form to config_item items in the views UI.
  */
 function views_ui_config_item_group_form($type, &$form_state) {
-  $view = &$form_state['view'];
+  $view = $form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
   $id = $form_state['id'];
@@ -4272,7 +4272,7 @@
       $form['#title'] = t('Configure group settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->ui_name()));
 
       $handler->groupby_form($form['options'], $form_state);
-      $form_state['handler'] = &$handler;
+      $form_state['handler'] = $handler;
     }
 
     views_ui_standard_form_buttons($form, $form_state, 'views_ui_config_item_group_form');
@@ -4336,7 +4336,7 @@
  * Form to config_item items in the views UI.
  */
 function views_ui_config_item_extra_form($form, &$form_state) {
-  $view = &$form_state['view'];
+  $view = $form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
   $id = $form_state['id'];
@@ -4368,7 +4368,7 @@
 
       // Get form from the handler.
       $handler->extra_options_form($form['options'], $form_state);
-      $form_state['handler'] = &$handler;
+      $form_state['handler'] = $handler;
     }
 
     views_ui_standard_form_buttons($form, $form_state, 'views_ui_config_item_extra_form');
@@ -4407,7 +4407,7 @@
  * Form to config_style items in the views UI.
  */
 function views_ui_config_style_form($form, &$form_state) {
-  $view = &$form_state['view'];
+  $view = $form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
   $id = $form_state['id'];
@@ -4447,7 +4447,7 @@
         $plugin->options_form($form['style_options'], $form_state);
       }
 
-      $form_state['handler'] = &$handler;
+      $form_state['handler'] = $handler;
     }
 
     views_ui_standard_form_buttons($form, $form_state, 'views_ui_config_style_form');
@@ -4985,7 +4985,7 @@
  *
  * @todo Remove this function once editing the display title is possible.
  */
-function views_ui_get_display_label($view, $display_id, $check_changed = TRUE) {
+function views_ui_get_display_label(view $view, $display_id, $check_changed = TRUE) {
   $title = $display_id == 'default' ? t('Master') : $view->display[$display_id]->display_title;
   $title = views_ui_truncate($title, 25);
 
diff --git a/includes/analyze.inc b/includes/analyze.inc
index c95fd10..6245945 100644
--- a/includes/analyze.inc
+++ b/includes/analyze.inc
@@ -19,7 +19,7 @@
  *   An array of analyze results organized into arrays keyed by 'ok',
  *   'warning' and 'error'.
  */
-function views_analyze_view(&$view) {
+function views_analyze_view(view $view) {
   $view->init_display();
   $messages = module_invoke_all('views_analyze', $view);
 
@@ -32,7 +32,7 @@
  * This is based upon the format of drupal_set_message which uses separate
  * boxes for "ok", "warning" and "error".
  */
-function views_analyze_format_result($view, $messages) {
+function views_analyze_format_result(view $view, $messages) {
   if (empty($messages)) {
     $messages = array(views_ui_analysis(t('View analysis can find nothing to report.'), 'ok'));
   }
@@ -96,7 +96,7 @@
  * There are other analysis tools in core specific sections, such as
  * node.views.inc as well.
  */
-function views_ui_views_analyze($view) {
+function views_ui_views_analyze(view $view) {
   $ret = array();
   // Check for something other than the default display:
   if (count($view->display) < 2) {
diff --git a/includes/handlers.inc b/includes/handlers.inc
index ac89fdb..5a29016 100644
--- a/includes/handlers.inc
+++ b/includes/handlers.inc
@@ -91,7 +91,7 @@
     }
 
     if (isset($h['arguments'])) {
-      call_user_func_array(array(&$handler, 'construct'), $h['arguments']);
+      call_user_func_array(array($handler, 'construct'), $h['arguments']);
     }
     else {
       $handler->construct();
@@ -153,8 +153,8 @@
    *   The item from the database; the actual contents of this will vary
    *   based upon the type of handler.
    */
-  function init(&$view, &$options) {
-    $this->view = &$view;
+  function init(view $view, &$options) {
+    $this->view = $view;
     $display_id = $this->view->current_display;
     // Check to see if this handler type is defaulted. Note that
     // we have to do a lookup because the type is singular but the
@@ -207,7 +207,7 @@
       }
     }
 
-    $this->query = &$view->query;
+    $this->query = $view->query;
   }
 
   function option_definition() {
@@ -337,7 +337,7 @@
    * Provide a form for aggregation settings.
    */
   function groupby_form(&$form, &$form_state) {
-    $view = &$form_state['view'];
+    $view = $form_state['view'];
     $display_id = $form_state['display_id'];
     $types = views_object_types();
     $type = $form_state['type'];
@@ -650,8 +650,8 @@
  *
  */
 class views_many_to_one_helper {
-  function views_many_to_one_helper(&$handler) {
-    $this->handler = &$handler;
+  function views_many_to_one_helper(views_handler $handler) {
+    $this->handler = $handler;
   }
 
   static function option_definition(&$options) {
@@ -750,8 +750,8 @@
 
     // shortcuts
     $options = $this->handler->options;
-    $view = &$this->handler->view;
-    $query = &$this->handler->query;
+    $view = $this->handler->view;
+    $query = $this->handler->query;
 
     if (!empty($options['require_value'])) {
       $join->type = 'INNER';
@@ -961,7 +961,7 @@
  *   - operator: Either 'and' or 'or'
  *   - value: An array of numeric values.
  */
-function views_break_phrase_string($str, &$handler = NULL) {
+function views_break_phrase_string($str, $handler = NULL) {
   if (!$handler) {
     $handler = new stdClass();
   }
@@ -1014,7 +1014,7 @@
  * @return $handler
  *   The new handler object.
  */
-function views_break_phrase($str, &$handler = NULL) {
+function views_break_phrase($str, $handler = NULL) {
   if (!$handler) {
     $handler = new stdClass();
   }
@@ -1296,7 +1296,7 @@
  *     parent::construct($table, $left_table, $left_field, $field, $extra, $type);
  *   }
  *
- *   function join($table, &$query) {
+ *   function join($table, $query) {
  *     $output = parent::join($table, $query);
  *   }
  *   $output .= "AND foo.bar = baz.boing";
@@ -1464,7 +1464,7 @@
 /**
  * Join handler for relationships that join with a subquery as the left field.
  * eg:
- *  LEFT JOIN node node_term_data ON ([YOUR SUBQUERY HERE]) = node_term_data.nid 
+ *  LEFT JOIN node node_term_data ON ([YOUR SUBQUERY HERE]) = node_term_data.nid
  *
  * join definition
  *   same as views_join class above, except:
@@ -1475,7 +1475,7 @@
     parent::construct($table, $left_table, $left_field, $field, $extra, $type);
     $this->left_query = $this->definition['left_query'];
   }
-  
+
   /**
    * Build the SQL for the join this object represents.
    *
diff --git a/includes/view.inc b/includes/view.inc
index 49f3b9a..85f26b7 100644
--- a/includes/view.inc
+++ b/includes/view.inc
@@ -289,13 +289,13 @@
         // This assumes that the 'default' handler is always first. It always
         // is. Make sure of it.
         if ($id != 'default') {
-          $this->display[$id]->handler->default_display = &$this->display['default']->handler;
+          $this->display[$id]->handler->default_display = $this->display['default']->handler;
         }
       }
     }
 
     $this->current_display = 'default';
-    $this->display_handler = &$this->display['default']->handler;
+    $this->display_handler = $this->display['default']->handler;
 
     return TRUE;
   }
@@ -365,7 +365,7 @@
     }
 
     // Set a shortcut
-    $this->display_handler = &$this->display[$display_id]->handler;
+    $this->display_handler = $this->display[$display_id]->handler;
 
     return TRUE;
   }
@@ -614,7 +614,7 @@
     // Iterate through each argument and process.
     foreach ($this->argument as $id => $arg) {
       $position++;
-      $argument = &$this->argument[$id];
+      $argument = $this->argument[$id];
 
       if ($argument->broken()) {
         continue;
@@ -2184,7 +2184,7 @@
       $this->display[$id]->handler->init($this, $this->display[$id]);
       // If this is NOT the default display handler, let it know which is
       if ($id != 'default') {
-        $this->display[$id]->handler->default_display = &$this->display['default']->handler;
+        $this->display[$id]->handler->default_display = $this->display['default']->handler;
       }
     }
 
diff --git a/modules/comment.views.inc b/modules/comment.views.inc
index 43bc6e1..40ee65b 100644
--- a/modules/comment.views.inc
+++ b/modules/comment.views.inc
@@ -584,12 +584,12 @@
  */
 function template_preprocess_views_view_row_comment(&$vars) {
   $options = $vars['options'];
-  $view = &$vars['view'];
-  $plugin = &$view->style_plugin->row_plugin;
+  $view = $vars['view'];
+  $plugin = $view->style_plugin->row_plugin;
   $comment = $plugin->comments[$vars['row']->{$vars['field_alias']}];
   $node = node_load($comment->nid);
   // Put the view on the node so we can retrieve it in the preprocess.
-  $node->view = &$view;
+  $node->view = $view;
 
   $build = comment_view_multiple(array($comment->cid => $comment), $node);
   // If we're displaying the comments without links, remove them from the
diff --git a/modules/comment/views_handler_field_comment.inc b/modules/comment/views_handler_field_comment.inc
index 871b096..4b54604 100644
--- a/modules/comment/views_handler_field_comment.inc
+++ b/modules/comment/views_handler_field_comment.inc
@@ -6,7 +6,7 @@
   /**
    * Override init function to provide generic option to link to comment.
    */
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
     if (!empty($this->options['link_to_comment'])) {
       $this->additional_fields['cid'] = 'cid';
diff --git a/modules/comment/views_handler_field_comment_username.inc b/modules/comment/views_handler_field_comment_username.inc
index 7362643..5e2b6d9 100644
--- a/modules/comment/views_handler_field_comment_username.inc
+++ b/modules/comment/views_handler_field_comment_username.inc
@@ -6,7 +6,7 @@
   /**
    * Override init function to add uid and homepage fields.
    */
-  function init(&$view, &$data) {
+  function init(view $view, &$data) {
     parent::init($view, $data);
     $this->additional_fields['uid'] = 'uid';
     $this->additional_fields['homepage'] = 'homepage';
diff --git a/modules/comment/views_handler_field_node_new_comments.inc b/modules/comment/views_handler_field_node_new_comments.inc
index 6c5835f..7dd9db0 100644
--- a/modules/comment/views_handler_field_node_new_comments.inc
+++ b/modules/comment/views_handler_field_node_new_comments.inc
@@ -4,7 +4,7 @@
  * Field handler to display the number of new comments
  */
 class views_handler_field_node_new_comments extends views_handler_field_numeric {
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
 
     // translate an older setting:
diff --git a/modules/field/views_handler_field_field.inc b/modules/field/views_handler_field_field.inc
index 3da050b..c200993 100644
--- a/modules/field/views_handler_field_field.inc
+++ b/modules/field/views_handler_field_field.inc
@@ -41,7 +41,7 @@
    */
   public $field_info = array();
 
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
 
     $this->field_info = $field = field_info_field($this->definition['field_name']);
diff --git a/modules/field/views_handler_relationship_entity_reverse.inc b/modules/field/views_handler_relationship_entity_reverse.inc
index 1189a36..8e85741 100644
--- a/modules/field/views_handler_relationship_entity_reverse.inc
+++ b/modules/field/views_handler_relationship_entity_reverse.inc
@@ -5,7 +5,7 @@
  */
 
 class views_handler_relationship_entity_reverse extends views_handler_relationship  {
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
 
     $this->field_info = field_info_field($this->definition['field_name']);
diff --git a/modules/node.views.inc b/modules/node.views.inc
index 68f8421..a9ce23f 100644
--- a/modules/node.views.inc
+++ b/modules/node.views.inc
@@ -677,7 +677,7 @@
 /**
  * Implements hook_views_analyze().
  */
-function node_views_analyze($view) {
+function node_views_analyze(view $view) {
   $ret = array();
   // Check for something other than the default display:
   if ($view->base_table == 'node') {
diff --git a/modules/node/views_handler_field_history_user_timestamp.inc b/modules/node/views_handler_field_history_user_timestamp.inc
index 196d443..fe19dc3 100644
--- a/modules/node/views_handler_field_history_user_timestamp.inc
+++ b/modules/node/views_handler_field_history_user_timestamp.inc
@@ -5,7 +5,7 @@
  * The handler is named history_user, because of compability reasons, the table is history.
  */
 class views_handler_field_history_user_timestamp extends views_handler_field_node {
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
     global $user;
     if ($user->uid) {
diff --git a/modules/node/views_handler_field_node.inc b/modules/node/views_handler_field_node.inc
index dd07b6c..7ecd9aa 100644
--- a/modules/node/views_handler_field_node.inc
+++ b/modules/node/views_handler_field_node.inc
@@ -11,7 +11,7 @@
  */
 class views_handler_field_node extends views_handler_field {
 
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
     if (!empty($this->options['link_to_node'])) {
       $this->additional_fields['nid'] = array('table' => 'node', 'field' => 'nid');
diff --git a/modules/node/views_handler_field_node_revision.inc b/modules/node/views_handler_field_node_revision.inc
index f4ca17d..585a022 100644
--- a/modules/node/views_handler_field_node_revision.inc
+++ b/modules/node/views_handler_field_node_revision.inc
@@ -5,7 +5,7 @@
  */
 
 class views_handler_field_node_revision extends views_handler_field_node {
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
     if (!empty($this->options['link_to_node_revision'])) {
       $this->additional_fields['vid'] = 'vid';
diff --git a/modules/node/views_plugin_row_node_view.inc b/modules/node/views_plugin_row_node_view.inc
index 040e7bd..bfb5dde 100644
--- a/modules/node/views_plugin_row_node_view.inc
+++ b/modules/node/views_plugin_row_node_view.inc
@@ -17,7 +17,7 @@
   // Stores the nodes loaded with pre_render.
   var $nodes = array();
 
-  function init(&$view, &$display, $options = NULL) {
+  function init(view $view, views_plugin_display $display, $options = NULL) {
     parent::init($view, $display, $options);
     // Handle existing views with the deprecated 'teaser' option.
     if (isset($this->options['teaser'])) {
diff --git a/modules/statistics/views_handler_field_accesslog_path.inc b/modules/statistics/views_handler_field_accesslog_path.inc
index 03fa7d2..d3f8ab5 100644
--- a/modules/statistics/views_handler_field_accesslog_path.inc
+++ b/modules/statistics/views_handler_field_accesslog_path.inc
@@ -6,7 +6,7 @@
   /**
    * Override init function to provide generic option to link to node.
    */
-  function init(&$view, $options) {
+  function init(view $view, $options) {
     parent::init($view, $options);
     if (!empty($this->options['display_as_link'])) {
       $this->additional_fields['path'] = 'path';
diff --git a/modules/system/views_handler_field_file.inc b/modules/system/views_handler_field_file.inc
index 6d1660e..8890e37 100644
--- a/modules/system/views_handler_field_file.inc
+++ b/modules/system/views_handler_field_file.inc
@@ -6,7 +6,7 @@
   /**
    * Constructor to provide additional field to add.
    */
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
     if (!empty($options['link_to_file'])) {
       $this->additional_fields['uri'] = 'uri';
diff --git a/modules/taxonomy/views_handler_argument_term_node_tid_depth_modifier.inc b/modules/taxonomy/views_handler_argument_term_node_tid_depth_modifier.inc
index e28b9eb..2c09e9f 100644
--- a/modules/taxonomy/views_handler_argument_term_node_tid_depth_modifier.inc
+++ b/modules/taxonomy/views_handler_argument_term_node_tid_depth_modifier.inc
@@ -45,7 +45,7 @@
         unset($handler);
       }
 
-      $handler = &$this->view->argument[$key];
+      $handler = $this->view->argument[$key];
       if (empty($handler->definition['accept depth modifier'])) {
         continue;
       }
diff --git a/modules/taxonomy/views_handler_field_term_node_tid.inc b/modules/taxonomy/views_handler_field_term_node_tid.inc
index b77b157..f8cbddf 100644
--- a/modules/taxonomy/views_handler_field_term_node_tid.inc
+++ b/modules/taxonomy/views_handler_field_term_node_tid.inc
@@ -5,7 +5,7 @@
  * Field handler to display all taxonomy terms of a node.
  */
 class views_handler_field_term_node_tid extends views_handler_field_prerender_list {
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
     // @todo: Wouldn't it be possible to use $this->base_table and no if here?
     if ($view->base_table == 'node_revision') {
diff --git a/modules/taxonomy/views_handler_filter_term_node_tid.inc b/modules/taxonomy/views_handler_filter_term_node_tid.inc
index 486b23c..c7f3bed 100644
--- a/modules/taxonomy/views_handler_filter_term_node_tid.inc
+++ b/modules/taxonomy/views_handler_filter_term_node_tid.inc
@@ -4,7 +4,7 @@
  * Filter by term id
  */
 class views_handler_filter_term_node_tid extends views_handler_filter_many_to_one {
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
     if (!empty($this->definition['vocabulary'])) {
       $this->options['vocabulary'] = $this->definition['vocabulary'];
diff --git a/modules/taxonomy/views_handler_relationship_node_term_data.inc b/modules/taxonomy/views_handler_relationship_node_term_data.inc
index 2f013da..42c0160 100644
--- a/modules/taxonomy/views_handler_relationship_node_term_data.inc
+++ b/modules/taxonomy/views_handler_relationship_node_term_data.inc
@@ -5,7 +5,7 @@
  */
 
 class views_handler_relationship_node_term_data extends views_handler_relationship  {
-  function init(&$view, &$options) {
+  function init(view $view, &$options) {
     parent::init($view, $options);
 
     // Convert legacy vids option to machine name vocabularies.
diff --git a/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc b/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc
index c8c6bf0..6e62ea9 100644
--- a/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc
+++ b/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc
@@ -5,7 +5,7 @@
  */
 
 class views_plugin_argument_default_taxonomy_tid extends views_plugin_argument_default {
-  function init(&$view, &$argument, $options) {
+  function init(view $view, &$argument, $options) {
     parent::init($view, $argument, $options);
 
     // Convert legacy vids option to machine name vocabularies.
diff --git a/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc b/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc
index c245f3c..33e1c12 100644
--- a/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc
+++ b/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc
@@ -8,7 +8,7 @@
  * Validate whether an argument is an acceptable node.
  */
 class views_plugin_argument_validate_taxonomy_term extends views_plugin_argument_validate {
-  function init(&$view, &$argument, $options) {
+  function init(view $view, &$argument, $options) {
     parent::init($view, $argument, $options);
 
     // Convert legacy vids option to machine name vocabularies.
diff --git a/modules/user.views.inc b/modules/user.views.inc
index 2ea2715..2e052dd 100644
--- a/modules/user.views.inc
+++ b/modules/user.views.inc
@@ -505,7 +505,7 @@
 /**
  * Allow replacement of current userid so we can cache these queries
  */
-function user_views_query_substitutions($view) {
+function user_views_query_substitutions(view $view) {
   global $user;
   return array('***CURRENT_USER***' => intval($user->uid));
 }
diff --git a/modules/user/views_handler_field_user.inc b/modules/user/views_handler_field_user.inc
index e88033a..2a3ff35 100644
--- a/modules/user/views_handler_field_user.inc
+++ b/modules/user/views_handler_field_user.inc
@@ -7,7 +7,7 @@
   /**
    * Override init function to provide generic option to link to user.
    */
-  function init(&$view, &$data) {
+  function init(view $view, &$data) {
     parent::init($view, $data);
     if (!empty($this->options['link_to_user'])) {
       $this->additional_fields['uid'] = 'uid';
diff --git a/modules/user/views_handler_field_user_name.inc b/modules/user/views_handler_field_user_name.inc
index 3b04dd1..9fe0ac9 100644
--- a/modules/user/views_handler_field_user_name.inc
+++ b/modules/user/views_handler_field_user_name.inc
@@ -6,7 +6,7 @@
   /**
    * Add uid in the query so we can test for anonymous if needed.
    */
-  function init(&$view, &$data) {
+  function init(view $view, &$data) {
     parent::init($view, $data);
     if (!empty($this->options['overwrite_anonymous'])) {
       $this->additional_fields['uid'] = 'uid';
diff --git a/plugins/export_ui/views_ui.class.php b/plugins/export_ui/views_ui.class.php
index 5d0dc6a..7e9b252 100644
--- a/plugins/export_ui/views_ui.class.php
+++ b/plugins/export_ui/views_ui.class.php
@@ -161,7 +161,7 @@
     );
   }
 
-  function list_filter($form_state, $view) {
+  function list_filter($form_state, view $view) {
     if ($form_state['values']['base'] != 'all' && $form_state['values']['base'] != $view->base_table) {
       return TRUE;
     }
@@ -180,7 +180,7 @@
   }
 
 
-  function list_build_row($view, &$form_state, $operations) {
+  function list_build_row(view $view, &$form_state, $operations) {
     if (!empty($view->human_name)) {
       $title = $view->human_name;
     }
@@ -299,7 +299,7 @@
 
     $form_state = array(
       'plugin' => $this->plugin,
-      'object' => &$this,
+      'object' => $this,
       'ajax' => $js,
       'item' => $item,
       'op' => 'add',
diff --git a/plugins/views_plugin_access.inc b/plugins/views_plugin_access.inc
index b3fbb29..e43abaf 100644
--- a/plugins/views_plugin_access.inc
+++ b/plugins/views_plugin_access.inc
@@ -14,9 +14,9 @@
    * @param $display
    *   The display handler.
    */
-  function init(&$view, &$display) {
-    $this->view = &$view;
-    $this->display = &$display;
+  function init(view $view, views_plugin_display $display) {
+    $this->view = $view;
+    $this->display = $display;
 
     if (is_object($display->handler)) {
       $options = $display->handler->get_option('access');
diff --git a/plugins/views_plugin_argument_default.inc b/plugins/views_plugin_argument_default.inc
index bc284df..9a7e2aa 100644
--- a/plugins/views_plugin_argument_default.inc
+++ b/plugins/views_plugin_argument_default.inc
@@ -29,8 +29,8 @@
    * Initialize this plugin with the view and the argument
    * it is linked to.
    */
-  function init(&$view, &$argument, $options) {
-    $this->view = &$view;
+  function init(view $view, &$argument, $options) {
+    $this->view = $view;
     $this->argument = &$argument;
 
     $this->convert_options($options);
diff --git a/plugins/views_plugin_argument_default_php.inc b/plugins/views_plugin_argument_default_php.inc
index 699dae7..170d20f 100644
--- a/plugins/views_plugin_argument_default_php.inc
+++ b/plugins/views_plugin_argument_default_php.inc
@@ -43,7 +43,7 @@
 
   function get_argument() {
     // set up variables to make it easier to reference during the argument.
-    $view = &$this->view;
+    $view = $this->view;
     $argument = &$this->argument;
     ob_start();
     $result = eval($this->options['code']);
diff --git a/plugins/views_plugin_argument_validate.inc b/plugins/views_plugin_argument_validate.inc
index 7071a62..f1f5c45 100644
--- a/plugins/views_plugin_argument_validate.inc
+++ b/plugins/views_plugin_argument_validate.inc
@@ -24,8 +24,8 @@
    * Initialize this plugin with the view and the argument
    * it is linked to.
    */
-  function init(&$view, &$argument, $options) {
-    $this->view = &$view;
+  function init(view $view, &$argument, $options) {
+    $this->view = $view;
     $this->argument = &$argument;
 
     $this->convert_options($options);
diff --git a/plugins/views_plugin_argument_validate_php.inc b/plugins/views_plugin_argument_validate_php.inc
index a4c3ae8..39e12ff 100644
--- a/plugins/views_plugin_argument_validate_php.inc
+++ b/plugins/views_plugin_argument_validate_php.inc
@@ -44,7 +44,7 @@
 
   function validate_argument($argument) {
     // set up variables to make it easier to reference during the argument.
-    $view = &$this->view;
+    $view = $this->view;
     $handler = &$this->argument;
 
     ob_start();
diff --git a/plugins/views_plugin_cache.inc b/plugins/views_plugin_cache.inc
index 8944071..6e77639 100644
--- a/plugins/views_plugin_cache.inc
+++ b/plugins/views_plugin_cache.inc
@@ -24,9 +24,9 @@
    * @param $display
    *   The display handler.
    */
-  function init(&$view, &$display) {
-    $this->view = &$view;
-    $this->display = &$display;
+  function init(view $view, views_plugin_display $display) {
+    $this->view = $view;
+    $this->display = $display;
 
     if (is_object($display->handler)) {
       $options = $display->handler->get_option('cache');
@@ -52,7 +52,7 @@
    *   The cache type, either 'query', 'result' or 'output'.
    */
    function cache_expire($type) { }
-   
+
    /**
     * Determine expiration time in the cache table of the cache type
     * or CACHE_PERMANENT if item shouldn't be removed automatically from cache.
@@ -172,7 +172,7 @@
    */
   function cache_start() {
     $this->storage['head'] = drupal_add_html_head();
-    $this->storage['css'] = drupal_add_css();  
+    $this->storage['css'] = drupal_add_css();
     $this->storage['js'] = drupal_add_js();
   }
 
@@ -251,9 +251,9 @@
     global $user;
 
     if (!isset($this->_results_key)) {
-      
+
       $build_info = $this->view->build_info;
-      
+
       foreach (array('query', 'count_query') as $index) {
         $query = clone $build_info[$index];
         $query->preExecute();
diff --git a/plugins/views_plugin_display.inc b/plugins/views_plugin_display.inc
index c4a34bc..1190dfb 100644
--- a/plugins/views_plugin_display.inc
+++ b/plugins/views_plugin_display.inc
@@ -38,9 +38,9 @@
    */
   var $extender = array();
 
-  function init(&$view, &$display, $options = NULL) {
-    $this->view = &$view;
-    $this->display = &$display;
+  function init(view $view, views_plugin_display $display, $options = NULL) {
+    $this->view = $view;
+    $this->display = $display;
 
     // Make some modifications:
     if (!isset($options) && isset($display->display_options)) {
@@ -817,7 +817,7 @@
           }
 
           $handler->init($this->view, $info);
-          $this->handlers[$type][$id] = &$handler;
+          $this->handlers[$type][$id] = $handler;
         }
 
         // Prevent reference problems.
diff --git a/plugins/views_plugin_display_extender.inc b/plugins/views_plugin_display_extender.inc
index 250cd83..23306f2 100644
--- a/plugins/views_plugin_display_extender.inc
+++ b/plugins/views_plugin_display_extender.inc
@@ -3,7 +3,7 @@
  * @todo
  */
 class views_plugin_display_extender extends views_plugin {
-  function __construct(&$view, &$display) {
+  function __construct(view $view, views_plugin_display $display) {
     $this->view = $view;
     $this->display = $display;
   }
diff --git a/plugins/views_plugin_display_feed.inc b/plugins/views_plugin_display_feed.inc
index 7eb99ae..ae0b905 100644
--- a/plugins/views_plugin_display_feed.inc
+++ b/plugins/views_plugin_display_feed.inc
@@ -12,7 +12,7 @@
  * @ingroup views_display_plugins
  */
 class views_plugin_display_feed extends views_plugin_display_page {
-  function init(&$view, &$display, $options = NULL) {
+  function init(view $view, views_plugin_display $display, $options = NULL) {
     parent::init($view, $display, $options);
 
     // Set the default row style. Ideally this would be part of the option
diff --git a/plugins/views_plugin_exposed_form.inc b/plugins/views_plugin_exposed_form.inc
index 0300b28..0f0b364 100644
--- a/plugins/views_plugin_exposed_form.inc
+++ b/plugins/views_plugin_exposed_form.inc
@@ -13,9 +13,9 @@
    * @param $display
    *   The display handler.
    */
-  function init(&$view, &$display, $options = array()) {
-    $this->view = &$view;
-    $this->display = &$display;
+  function init(view $view, views_plugin_display $display, $options = array()) {
+    $this->view = $view;
+    $this->display = $display;
 
     $this->unpack_options($this->options, $options);
   }
@@ -112,8 +112,8 @@
   function render_exposed_form($block = FALSE) {
     // Deal with any exposed filters we may have, before building.
     $form_state = array(
-      'view' => &$this->view,
-      'display' => &$this->display,
+      'view' => $this->view,
+      'display' => $this->display,
       'method' => 'get',
       'rerender' => TRUE,
       'no_redirect' => TRUE,
diff --git a/plugins/views_plugin_localization.inc b/plugins/views_plugin_localization.inc
index 30ae965..a50b695 100644
--- a/plugins/views_plugin_localization.inc
+++ b/plugins/views_plugin_localization.inc
@@ -21,8 +21,8 @@
    * @param $view
    *   The view object.
    */
-  function init(&$view) {
-    $this->view = &$view;
+  function init(view $view) {
+    $this->view = $view;
   }
 
   /**
diff --git a/plugins/views_plugin_pager.inc b/plugins/views_plugin_pager.inc
index f39e2d3..eee872d 100644
--- a/plugins/views_plugin_pager.inc
+++ b/plugins/views_plugin_pager.inc
@@ -17,9 +17,9 @@
    * @param $display
    *   The display handler.
    */
-  function init(&$view, &$display, $options = array()) {
-    $this->view = &$view;
-    $this->display = &$display;
+  function init(view $view, views_plugin_display $display, $options = array()) {
+    $this->view = $view;
+    $this->display = $display;
 
     $this->unpack_options($this->options, $options);
   }
diff --git a/plugins/views_plugin_query.inc b/plugins/views_plugin_query.inc
index 0d71c14..2961fd0 100644
--- a/plugins/views_plugin_query.inc
+++ b/plugins/views_plugin_query.inc
@@ -34,12 +34,12 @@
   /**
    * Let modules modify the query just prior to finalizing it.
    */
-  function alter(&$view) {  }
+  function alter(view $view) {  }
 
   /**
    * Builds the necessary info to execute the query.
    */
-  function build(&$view) { }
+  function build(view $view) { }
 
   /**
    * Executes the query and fills the associated view object with according
@@ -50,7 +50,7 @@
    *
    * $view->result should contain an array of objects.
    */
-  function execute(&$view) {  }
+  function execute(view $view) {  }
 
   /**
    * Add a signature to the query, if such a thing is feasible.
@@ -58,7 +58,7 @@
    * This signature is something that can be used when perusing query logs to
    * discern where particular queries might be coming from.
    */
-  function add_signature(&$view) { }
+  function add_signature(view $view) { }
 
   /**
    * Get aggregation info for group by queries.
diff --git a/plugins/views_plugin_query_default.inc b/plugins/views_plugin_query_default.inc
index a898d1f..9bf545b 100644
--- a/plugins/views_plugin_query_default.inc
+++ b/plugins/views_plugin_query_default.inc
@@ -1065,7 +1065,7 @@
   /**
    * Build fields array.
    */
-  function compile_fields($fields_array, $query) {
+  function compile_fields($fields_array, SelectQueryInterface $query) {
     $non_aggregates = array();
     foreach ($fields_array as $field) {
       $string = '';
@@ -1263,7 +1263,7 @@
   /**
    * Let modules modify the query just prior to finalizing it.
    */
-  function alter(&$view) {
+  function alter(view $view) {
     foreach (module_implements('views_query_alter') as $module) {
       $function = $module . '_views_query_alter';
       $function($view, $this);
@@ -1273,7 +1273,7 @@
   /**
    * Builds the necessary info to execute the query.
    */
-  function build(&$view) {
+  function build(view $view) {
     // Make the query distinct if the option was set.
     if (!empty($this->options['distinct'])) {
       $this->set_distinct();
@@ -1298,7 +1298,7 @@
    * Values to set: $view->result, $view->total_rows, $view->execute_time,
    * $view->current_page.
    */
-  function execute(&$view) {
+  function execute(view $view) {
     $external = FALSE; // Whether this query will run against an external database.
     $query = $view->build_info['query'];
     $count_query = $view->build_info['count_query'];
@@ -1385,7 +1385,7 @@
     $view->execute_time = microtime(TRUE) - $start;
   }
 
-  function add_signature(&$view) {
+  function add_signature(view $view) {
     $view->query->add_field(NULL, "'" . $view->name . ':' . $view->current_display . "'", 'view_name');
   }
 
diff --git a/plugins/views_plugin_row.inc b/plugins/views_plugin_row.inc
index 36b02b1..0e2b596 100644
--- a/plugins/views_plugin_row.inc
+++ b/plugins/views_plugin_row.inc
@@ -25,9 +25,9 @@
   /**
    * Initialize the row plugin.
    */
-  function init(&$view, &$display, $options = NULL) {
-    $this->view = &$view;
-    $this->display = &$display;
+  function init(view $view, views_plugin_display $display, $options = NULL) {
+    $this->view = $view;
+    $this->display = $display;
 
     // Overlay incoming options on top of defaults
     $this->unpack_options($this->options, isset($options) ? $options : $display->handler->get_option('row_options'));
@@ -52,7 +52,7 @@
    */
   function options_form(&$form, &$form_state) {
     if (isset($this->base_table)) {
-      $view = &$form_state['view'];
+      $view = $form_state['view'];
 
       // A whole bunch of code to figure out what relationships are valid for
       // this item.
diff --git a/plugins/views_plugin_style.inc b/plugins/views_plugin_style.inc
index 4a880d9..8745f32 100644
--- a/plugins/views_plugin_style.inc
+++ b/plugins/views_plugin_style.inc
@@ -31,9 +31,9 @@
    *   The style options might come externally as the style can be sourced
    *   from at least two locations. If it's not included, look on the display.
    */
-  function init(&$view, &$display, $options = NULL) {
-    $this->view = &$view;
-    $this->display = &$display;
+  function init(view $view, views_plugin_display $display, $options = NULL) {
+    $this->view = $view;
+    $this->display = $display;
 
     // Overlay incoming options on top of defaults
     $this->unpack_options($this->options, isset($options) ? $options : $display->handler->get_option('style_options'));
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 7a501ba..3f39a74 100644
--- a/plugins/views_wizard/views_ui_base_views_wizard.class.php
+++ b/plugins/views_wizard/views_ui_base_views_wizard.class.php
@@ -431,7 +431,7 @@
     $sorts = array(
       'none' => t('Unsorted'),
     );
-    // Check if we are allowed to sort by creation date.    
+    // Check if we are allowed to sort by creation date.
     if (!empty($this->plugin['created_column'])) {
       $sorts += array(
         $this->plugin['created_column'] . ':DESC' => t('Newest first'),
@@ -550,7 +550,7 @@
   /**
    * Add the array of display options to the view, with appropriate overrides.
    */
-  protected function add_displays($view, $display_options, $form, $form_state) {
+  protected function add_displays(view $view, $display_options, $form, $form_state) {
     // Display: Master
     $default_display = $view->new_display('default', 'Master', 'default');
     foreach ($display_options['default'] as $option => $value) {
@@ -793,7 +793,7 @@
    * @param $default_display
    *   The default display, which will store the options when possible.
    */
-  protected function set_default_options($options, $display, $default_display) {
+  protected function set_default_options($options, views_plugin_display $display, $default_display) {
     foreach ($options as $option => $value) {
       // If the default display supports this option, set the value there.
       // Otherwise, set it on the provided display.
@@ -829,7 +829,7 @@
    *   The default display, from which the options will be inherited when
    *   possible.
    */
-  protected function set_override_options($options, $display, $default_display) {
+  protected function set_override_options($options, views_plugin_display $display, $default_display) {
     foreach ($options as $option => $value) {
       // Only override the default value if it is different from the value that
       // was provided.
@@ -852,7 +852,7 @@
     return $view;
   }
 
-  protected function set_validated_view($form, $form_state, $view) {
+  protected function set_validated_view($form, $form_state, view $view) {
     $key = hash('sha256', serialize($form_state['values']));
     $this->validated_views[$key] = $view;
   }
diff --git a/tests/views_query.test b/tests/views_query.test
index 4363721..29242b0 100644
--- a/tests/views_query.test
+++ b/tests/views_query.test
@@ -24,7 +24,7 @@
    *  An associative array mapping the columns of the result set from the view
    *  (as keys) and the expected result set (as values).
    */
-  protected function assertIdenticalResultset($view, $expected_result, $column_map = array(), $message = 'Identical result set') {
+  protected function assertIdenticalResultset(view $view, $expected_result, $column_map = array(), $message = 'Identical result set') {
     return $this->assertIdenticalResultsetHelper($view, $expected_result, $column_map, $message, 'assertIdentical');
   }
 
@@ -41,11 +41,11 @@
    *  An associative array mapping the columns of the result set from the view
    *  (as keys) and the expected result set (as values).
    */
-  protected function assertNotIdenticalResultset($view, $expected_result, $column_map = array(), $message = 'Identical result set') {
+  protected function assertNotIdenticalResultset(view $view, $expected_result, $column_map = array(), $message = 'Identical result set') {
     return $this->assertIdenticalResultsetHelper($view, $expected_result, $column_map, $message, 'assertNotIdentical');
   }
 
-  protected function assertIdenticalResultsetHelper($view, $expected_result, $column_map, $message, $assert_method) {
+  protected function assertIdenticalResultsetHelper(view $view, $expected_result, $column_map, $message, $assert_method) {
     // Convert $view->result to an array of arrays.
     $result = array();
     foreach ($view->result as $key => $value) {
@@ -112,7 +112,7 @@
   /**
    * Helper function to execute a view with debugging.
    */
-  protected function executeView($view, $args = array()) {
+  protected function executeView(view $view, $args = array()) {
     $view->set_display();
     $view->pre_execute($args);
     $view->execute();
diff --git a/tests/views_view.test b/tests/views_view.test
index 6c18a84..567e076 100644
--- a/tests/views_view.test
+++ b/tests/views_view.test
@@ -30,7 +30,7 @@
     $this->assertViewDestroy($view);
   }
 
-  function assertViewDestroy($view) {
+  function assertViewDestroy(view $view) {
     $this->assertFalse(isset($view->display['default']->handler), 'Take sure all displays are destroyed.');
     $this->assertFalse(isset($view->display['attachment_1']->handler), 'Take sure all displays are destroyed.');
 
@@ -67,7 +67,7 @@
   }
 
   function testValidate() {
-    // Test a view with multiple displays. 
+    // Test a view with multiple displays.
     // Validating a view shouldn't change the active display.
     // @todo: Create an extra validation view.
     $view = $this->view_test_destroy();
diff --git a/theme/theme.inc b/theme/theme.inc
index 61eea65..c373475 100644
--- a/theme/theme.inc
+++ b/theme/theme.inc
@@ -17,7 +17,7 @@
  * @param $display
  *   The display being rendered, if applicable.
  */
-function _views_theme_functions($hook, $view, $display = NULL) {
+function _views_theme_functions($hook, view $view, $display = NULL) {
   $themes = array();
 
   if ($display) {
@@ -173,7 +173,7 @@
     $empty = $field_output !== 0 && empty($field_output);
     if (empty($field->options['exclude']) && (!$empty || (empty($field->options['hide_empty']) && empty($vars['options']['hide_empty'])))) {
       $object = new stdClass();
-      $object->handler = &$view->field[$id];
+      $object->handler = $view->field[$id];
       $object->inline = !empty($vars['options']['inline'][$id]);
 
       $object->element_type = $object->handler->element_type(TRUE, !$vars['options']['default_field_elements'], $object->inline);
@@ -420,7 +420,7 @@
   $options  = $view->style_plugin->options;
   $handler  = $view->style_plugin;
 
-  $fields   = &$view->field;
+  $fields   = $view->field;
   $columns  = $handler->sanitize_columns($options['columns'], $fields);
 
   $active   = !empty($handler->active) ? $handler->active : '';
@@ -747,11 +747,11 @@
   global $base_url;
   global $language;
 
-  $view     = &$vars['view'];
+  $view     = $vars['view'];
   $options  = &$vars['options'];
   $items    = &$vars['rows'];
 
-  $style    = &$view->style_plugin;
+  $style    = $view->style_plugin;
 
   // The RSS 2.0 "spec" doesn't indicate HTML can be used in the description.
   // We strip all HTML tags, but need to prevent double encoding from properly
@@ -807,9 +807,9 @@
  * Default theme function for all RSS rows.
  */
 function template_preprocess_views_view_row_rss(&$vars) {
-  $view     = &$vars['view'];
+  $view     = $vars['view'];
   $options  = &$vars['options'];
-  $item     = &$vars['row'];
+  $item     = $vars['row'];
 
   $vars['title'] = check_plain($item->title);
   $vars['link'] = check_url($item->link);
diff --git a/views.module b/views.module
index 259dc52..8b040d0 100644
--- a/views.module
+++ b/views.module
@@ -36,7 +36,7 @@
 /**
  * Returns a form ID for a Views form using the name and display of the View.
  */
-function views_form_id($view) {
+function views_form_id(view $view) {
   $parts = array(
     'views_form',
     $view->name,
@@ -263,7 +263,7 @@
 function views_preprocess_comment(&$vars) {
   // The 'view' attribute of the node is added in template_preprocess_views_view_row_comment()
   if (!empty($vars['node']->view) && !empty($vars['node']->view->name)) {
-    $vars['view'] = &$vars['node']->view;
+    $vars['view'] = $vars['node']->view;
     $vars['theme_hook_suggestions'][] = 'comment__view__' . $vars['node']->view->name;
     if (!empty($vars['node']->view->current_display)) {
       $vars['theme_hook_suggestions'][] = 'comment__view__' . $vars['node']->view->name . '__' . $vars['node']->view->current_display;
@@ -651,7 +651,7 @@
  *   The ID of the display within the view that was used to generate the block
  *   content.
  */
-function views_add_block_contextual_links(&$block, $view, $display_id) {
+function views_add_block_contextual_links(&$block, view $view, $display_id) {
   // Do not add contextual links to an empty block.
   if (!empty($block['content'])) {
     // Contextual links only work on blocks whose content is a renderable
@@ -729,7 +729,7 @@
  * @see views_page_alter()
  * @see template_preprocess_views_view()
  */
-function views_add_contextual_links(&$render_element, $location, $view, $display_id) {
+function views_add_contextual_links(&$render_element, $location, view $view, $display_id) {
   // Do not do anything if the view is configured to hide its administrative
   // links.
   if (empty($view->hide_admin_links)) {
@@ -1359,7 +1359,7 @@
 /**
  * Returns TRUE if a view is disabled, FALSE otherwise.
  */
-function views_view_is_disabled($view) {
+function views_view_is_disabled(view $view) {
   return !empty($view->disabled);
 }
 
@@ -1412,7 +1412,7 @@
 /**
  * Export callback to load the view subrecords, which are the displays.
  */
-function views_load_display_records(&$views) {
+function views_load_display_records(view $views) {
   // Get vids from the views.
   $names = array();
   foreach ($views as $view) {
@@ -1453,21 +1453,21 @@
 /**
  * Export CRUD callback to save a view.
  */
-function views_save_view(&$view) {
+function views_save_view(view $view) {
   return $view->save();
 }
 
 /**
  * Export CRUD callback to delete a view.
  */
-function views_delete_view(&$view) {
+function views_delete_view(view $view) {
   return $view->delete(TRUE);
 }
 
 /**
  * Export CRUD callback to export a view.
  */
-function views_export_view(&$view, $indent = '') {
+function views_export_view(view $view, $indent = '') {
   return $view->export($indent);
 }
 
@@ -1538,7 +1538,7 @@
  * Returns TRUE if the passed-in view contains handlers with views form
  * implementations, FALSE otherwise.
  */
-function views_view_has_form_elements($view) {
+function views_view_has_form_elements(view $view) {
   foreach ($view->field as $field) {
     if (property_exists($field, 'views_form_callback') || method_exists($field, 'views_form')) {
       return TRUE;
@@ -1560,7 +1560,7 @@
  * step (the default 'views_form_vews_form' step). That way it is actually
  * possible for modules to have a multistep form if they need to.
  */
-function views_form($form, &$form_state, $view, $output) {
+function views_form($form, &$form_state, view $view, $output) {
   $form_state['step'] = isset($form_state['step']) ? $form_state['step'] : 'views_form_views_form';
 
   $form = array();
@@ -1606,7 +1606,7 @@
  * Callback for the main step of a Views form.
  * Invoked by views_form().
  */
-function views_form_views_form($form, &$form_state, $view, $output) {
+function views_form_views_form($form, &$form_state, view $view, $output) {
   $form['#prefix'] = '<div class="views-form">';
   $form['#suffix'] = '</div>';
   $form['#theme'] = 'views_form_views_form';
@@ -1727,8 +1727,8 @@
   // Make sure that we validate because this form might be submitted
   // multiple times per page.
   $form_state['must_validate'] = TRUE;
-  $view = &$form_state['view'];
-  $display = &$form_state['display'];
+  $view = $form_state['view'];
+  $display = $form_state['display'];
 
   $form_state['input'] = $view->get_exposed_input();
 
@@ -1869,7 +1869,7 @@
 /**
  * Build a list of theme function names for use most everywhere.
  */
-function views_theme_functions($hook, $view, $display = NULL) {
+function views_theme_functions($hook, view $view, $display = NULL) {
   require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'views') . "/theme/theme.inc";
   return _views_theme_functions($hook, $view, $display);
 }
@@ -1877,7 +1877,7 @@
 /**
  * Substitute current time; this works with cached queries.
  */
-function views_views_query_substitutions($view) {
+function views_views_query_substitutions(view $view) {
   global $language_content;
   return array(
     '***CURRENT_VERSION***' => VERSION,
diff --git a/views_ui.module b/views_ui.module
index 73d1a90..f6456d4 100644
--- a/views_ui.module
+++ b/views_ui.module
@@ -225,7 +225,7 @@
 /**
  * Page title callback for the Edit View page.
  */
-function views_ui_edit_page_title($view) {
+function views_ui_edit_page_title(view $view) {
   module_load_include('inc', 'views_ui', 'includes/admin');
   $bases = views_fetch_base_tables();
   $name = $view->get_human_name();
@@ -283,7 +283,7 @@
  * Specialized cache function to add a flag to our view, include an appropriate
  * include, and cache more easily.
  */
-function views_ui_cache_set(&$view) {
+function views_ui_cache_set(view $view) {
   if (!empty($view->locked)) {
     drupal_set_message(t('Changes cannot be made to a locked view.'), 'error');
     return;
@@ -432,7 +432,7 @@
  * @param $title
  *   Add a bolded title of this section.
  */
-function views_ui_view_preview_section_handler_links($view, $type, $title = FALSE) {
+function views_ui_view_preview_section_handler_links(view $view, $type, $title = FALSE) {
   $display = $view->display_handler->display;
   $handlers = $view->display_handler->get_handlers($type);
   $links = array();
@@ -464,7 +464,7 @@
 /**
  * Returns a link to editing a certain display setting.
  */
-function views_ui_view_preview_section_display_category_links($view, $type, $title) {
+function views_ui_view_preview_section_display_category_links(view $view, $type, $title) {
   $display = $view->display_handler->display;
   $links = array(
     $type . '-edit' => array(
@@ -480,7 +480,7 @@
 /**
  * Returns all contextual links for the main content part of the view.
  */
-function views_ui_view_preview_section_rows_links($view) {
+function views_ui_view_preview_section_rows_links(view $view) {
   $display = $view->display_handler->display;
   $links = array();
   $links = array_merge($links, views_ui_view_preview_section_handler_links($view, 'filter', TRUE));
@@ -733,7 +733,7 @@
  * @return
  *   An array of links to this view's display paths.
  */
-function _views_ui_get_paths($view) {
+function _views_ui_get_paths(view $view) {
   $all_paths = array();
   if (empty($view->display)) {
     $all_paths[] = t('Edit this view to add a display.');
@@ -768,7 +768,7 @@
  * @return
  *   An array of display types that this view includes.
  */
-function _views_ui_get_displays_list($view) {
+function _views_ui_get_displays_list(view $view) {
   $displays = array();
   foreach ($view->display as $display) {
     if (!empty($display->handler->definition['admin'])) {
