Commit 089c38c9 authored by webchick's avatar webchick

Issue #1959338 by superspring, urwen, tim.plunkett, damiankloip: Reroll:...

Issue #1959338 by superspring, urwen, tim.plunkett, damiankloip: Reroll: Remove PHP4-style references for objects.
parent 4664d8af
......@@ -125,8 +125,8 @@ public function summaryJoin() {
// 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';
......
......@@ -353,9 +353,7 @@ public function buildGroupByForm(&$form, &$form_state) {
* There is no need for this function to actually store the data.
*/
public function submitGroupByForm(&$form, &$form_state) {
$item =& $form_state['handler']->options;
$item['group_type'] = $form_state['values']['options']['group_type'];
$form_state['handler']->options['group_type'] = $form_state['values']['options']['group_type'];
}
/**
......
......@@ -430,7 +430,7 @@ public function submitOptionsForm(&$form, &$form_state) {
}
// Clear out the content of title if it's not enabled.
$options =& $form_state['values']['options'];
$options = &$form_state['values']['options'];
if (empty($options['title_enable'])) {
$options['title'] = '';
}
......
......@@ -242,7 +242,7 @@ protected function leftQuery($options) {
// Workaround until http://drupal.org/node/844910 is fixed:
// Remove all fields from the SELECT except the base id.
$fields =& $subquery->getFields();
$fields = &$subquery->getFields();
foreach (array_keys($fields) as $field_name) {
// The base id for this subquery is stored in our definition.
if ($field_name != $this->definition['field']) {
......@@ -252,7 +252,7 @@ protected function leftQuery($options) {
// Make every alias in the subquery safe within the outer query by
// appending a namespace to it, '_inner' by default.
$tables =& $subquery->getTables();
$tables = &$subquery->getTables();
foreach (array_keys($tables) as $table_name) {
$tables[$table_name]['alias'] .= $this->subquery_namespace;
// Namespace the join on every table.
......@@ -266,13 +266,13 @@ protected function leftQuery($options) {
$fields[$field_name]['alias'] .= $this->subquery_namespace;
}
// Namespace conditions.
$where =& $subquery->conditions();
$where = &$subquery->conditions();
$this->alterSubqueryCondition($subquery, $where);
// Not sure why, but our sort order clause doesn't have a table.
// TODO: the call to add_item() above to add the sort handler is probably
// wrong -- needs attention from someone who understands it.
// In the meantime, this works, but with a leap of faith...
$orders =& $subquery->getOrderBy();
$orders = &$subquery->getOrderBy();
foreach ($orders as $order_key => $order) {
// But if we're using a whole view, we don't know what we have!
if ($options['subquery_view']) {
......@@ -314,7 +314,7 @@ protected function alterSubqueryCondition(AlterableInterface $query, &$condition
$condition['field'] = $this->conditionNamespace($condition['field']);
}
elseif (is_object($condition['field'])) {
$sub_conditions =& $condition['field']->conditions();
$sub_conditions = &$condition['field']->conditions();
$this->alterSubqueryCondition($query, $sub_conditions);
}
}
......
......@@ -510,7 +510,7 @@ public static function getSelected($form_state, $parents, $default_value, $eleme
* The display ID (e.g. 'page' or 'block').
*/
protected function buildFormStyle(array &$form, array &$form_state, $type) {
$style_form =& $form['displays'][$type]['options']['style'];
$style_form = &$form['displays'][$type]['options']['style'];
$style = $style_form['style_plugin']['#default_value'];
$style_plugin = Views::pluginManager('style')->createInstance($style);
if (isset($style_plugin) && $style_plugin->usesRowPlugin()) {
......
......@@ -206,7 +206,7 @@ public function testAlterUrl() {
// Get the expected start of the path string.
$base = ($absolute ? $base_url . '/' : base_path()) . $script_path;
$absolute_string = $absolute ? 'absolute' : NULL;
$alter =& $id_field->options['alter'];
$alter = &$id_field->options['alter'];
$alter['path'] = 'node/123';
$expected_result = url('node/123', array('absolute' => $absolute));
......
......@@ -914,7 +914,7 @@ protected function _buildArguments() {
// 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;
......@@ -2071,15 +2071,6 @@ public function getItem($display_id, $type, $id) {
return isset($fields[$id]) ? $fields[$id] : NULL;
}
/**
* Sets the build array used by the view.
*
* @param array $element
*/
public function setElement(&$element) {
$this->element =& $element;
}
/**
* Sets the configuration of a handler instance on a given display.
*
......
......@@ -247,7 +247,7 @@ function views_preprocess_comment(&$variables) {
// The view data is added to the comment in
// \Drupal\views\Plugin\views\row\EntityRow::preRender().
if (!empty($variables['comment']->view) && $variables['comment']->view->storage->id()) {
$variables['view'] = &$variables['comment']->view;
$variables['view'] = $variables['comment']->view;
}
}
......@@ -1242,7 +1242,7 @@ function views_pre_render_views_form_views_form($element) {
/**
* Form builder for the exposed widgets form.
*
* Be sure that $view and $display are references.
* Be sure that $display is a reference.
*/
function views_exposed_form($form, &$form_state) {
// Don't show the form when batch operations are in progress.
......@@ -1256,7 +1256,7 @@ function views_exposed_form($form, &$form_state) {
// Make sure that we validate because this form might be submitted
// multiple times per page.
$form_state['must_validate'] = TRUE;
$view = &$form_state['view'];
$view = $form_state['view'];
$display = &$form_state['display'];
$form_state['input'] = $view->getExposedInput();
......@@ -1401,8 +1401,8 @@ function views_exposed_form_cache($views_name, $display_name, $form_output = NUL
*/
function views_query_views_alter(AlterableInterface $query) {
$substitutions = $query->getMetaData('views_substitutions');
$tables =& $query->getTables();
$where =& $query->conditions();
$tables = &$query->getTables();
$where = &$query->conditions();
// Replaces substitions in tables.
foreach ($tables as $table_name => $table_metadata) {
......@@ -1427,7 +1427,7 @@ function _views_query_tag_alter_condition(AlterableInterface $query, &$condition
$condition['field'] = str_replace(array_keys($substitutions), array_values($substitutions), $condition['field']);
}
elseif (is_object($condition['field'])) {
$sub_conditions =& $condition['field']->conditions();
$sub_conditions = &$condition['field']->conditions();
_views_query_tag_alter_condition($query, $sub_conditions, $substitutions);
}
// $condition['value'] is a subquery so alter the subquery recursive.
......
......@@ -180,7 +180,7 @@ function template_preprocess_views_view_fields(&$variables) {
$empty = $field->isValueEmpty($field_output, $field->options['empty_zero']);
if (empty($field->options['exclude']) && (!$empty || (empty($field->options['hide_empty']) && empty($variables['options']['hide_empty'])))) {
$object = new stdClass();
$object->handler = &$view->field[$id];
$object->handler = $view->field[$id];
$object->inline = !empty($variables['options']['inline'][$id]);
$object->element_type = $object->handler->elementType(TRUE, !$variables['options']['default_field_elements'], $object->inline);
......@@ -958,11 +958,10 @@ function template_preprocess_views_view_list(&$variables) {
* An associative array containing:
* - view: A ViewExecutable object.
* - rows: The raw row data.
*/
*/
function template_preprocess_views_view_rss(&$variables) {
$view = $variables['view'];
$view = $variables['view'];
$items = $variables['rows'];
$style = $view->style_plugin;
$config = \Drupal::config('system.site');
......
......@@ -343,7 +343,7 @@ function views_ui_pre_render_move_argument_options($form) {
* 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'];
$executable = $view->getExecutable();
$displays = $executable->displayHandlers;
......
......@@ -49,7 +49,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
$view = $form_state['view'];
$display_id = $form_state['display_id'];
$type = $form_state['type'];
......
......@@ -34,7 +34,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
$view = $form_state['view'];
$form['#title'] = $this->t('View analysis');
$form['#section'] = 'analyze';
......
......@@ -51,7 +51,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
$view = $form_state['view'];
$display_id = $form_state['display_id'];
$type = $form_state['type'];
$id = $form_state['id'];
......@@ -158,7 +158,7 @@ public function buildForm(array $form, array &$form_state) {
// Get form from the handler.
$handler->buildOptionsForm($form['options'], $form_state);
$form_state['handler'] = &$handler;
$form_state['handler'] = $handler;
}
$name = NULL;
......
......@@ -50,7 +50,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
$view = $form_state['view'];
$display_id = $form_state['display_id'];
$type = $form_state['type'];
$id = $form_state['id'];
......@@ -81,7 +81,7 @@ public function buildForm(array $form, array &$form_state) {
// Get form from the handler.
$handler->buildExtraOptionsForm($form['options'], $form_state);
$form_state['handler'] = &$handler;
$form_state['handler'] = $handler;
}
$view->getStandardButtons($form, $form_state, 'views_ui_config_item_extra_form');
......
......@@ -51,7 +51,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
$view = $form_state['view'];
$display_id = $form_state['display_id'];
$type = $form_state['type'];
$id = $form_state['id'];
......@@ -84,7 +84,7 @@ public function buildForm(array $form, array &$form_state) {
$form['#title'] = $this->t('Configure aggregation settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->adminLabel()));
$handler->buildGroupByForm($form['options'], $form_state);
$form_state['handler'] = &$handler;
$form_state['handler'] = $handler;
}
$view->getStandardButtons($form, $form_state, 'views_ui_config_item_group_form');
......
......@@ -59,13 +59,12 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
$view = $form_state['view'];
$display_id = $form_state['display_id'];
$section = $form_state['section'];
$executable = $view->getExecutable();
$executable->setDisplay($display_id);
$display = &$executable->display[$display_id];
// Get form from the handler.
$form['options'] = array(
......
......@@ -33,7 +33,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
$view = $form_state['view'];
$form['#title'] = $this->t('View name and description');
$form['#section'] = 'details';
......
......@@ -48,7 +48,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
$view = $form_state['view'];
$display_id = $form_state['display_id'];
$type = $form_state['type'];
......
......@@ -34,7 +34,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
$view = $form_state['view'];
$display_id = $form_state['display_id'];
$type = 'filter';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment