diff --git a/core/modules/views/src/Plugin/views/join/FieldOrLanguageJoin.php b/core/modules/views/src/Plugin/views/join/FieldOrLanguageJoin.php index f679b52..fc4e07b 100644 --- a/core/modules/views/src/Plugin/views/join/FieldOrLanguageJoin.php +++ b/core/modules/views/src/Plugin/views/join/FieldOrLanguageJoin.php @@ -23,17 +23,16 @@ class FieldOrLanguageJoin extends JoinPluginBase { */ protected function joinAddExtra(&$arguments, &$condition, $table, SelectInterface $select_query, $left_table = NULL) { if (is_array($this->extra)) { - $extras = array(); + $extras = []; foreach ($this->extra as $extra) { $extras[] = $this->buildExtra($extra, $arguments, $table, $select_query, $left_table); } if ($extras) { - // Remove and store the langcode OR bundle join condition extra. $language_bundle_conditions = []; foreach ($extras as $key => &$extra) { - if (strpos($extra, '.langcode') !== FALSE || strpos($extra, '.bundle') !== FALSE ) { + if (strpos($extra, '.langcode') !== FALSE || strpos($extra, '.bundle') !== FALSE) { $language_bundle_conditions[] = $extra; unset($extras[$key]); } diff --git a/core/modules/views/src/Plugin/views/join/JoinPluginBase.php b/core/modules/views/src/Plugin/views/join/JoinPluginBase.php index fdcc37f..25fc259 100644 --- a/core/modules/views/src/Plugin/views/join/JoinPluginBase.php +++ b/core/modules/views/src/Plugin/views/join/JoinPluginBase.php @@ -280,16 +280,12 @@ public function buildJoin($select_query, $table, $view_query) { * * @param $arguments * Array of query arguments. - * * @param $condition * The condition to be built. - * * @param $table * The right table. - * * @param $select_query * The current select query being built. - * * @param $left_table * The left table. */ @@ -319,16 +315,12 @@ protected function joinAddExtra(&$arguments, &$condition, $table, SelectInterfac * * @param $extra * The extra information - * * @param $arguments * Array of query arguments. - * * @param $table * The right table. - * * @param $select_query * The current select query being built. - * * @param $left_table * The left table. * @@ -340,15 +332,15 @@ protected function buildExtra($extra, &$arguments, $table, SelectInterface $sele $extra += array( 'value' => NULL, ); - // Figure out the table name. Remember, only use aliases provided - // if at all possible. + // Figure out the table name. Remember, only use aliases provided if at all + // possible. $join_table = ''; if (!array_key_exists('table', $extra)) { $join_table = $table['alias'] . '.'; } elseif (isset($extra['table'])) { - // If we're aware of a table alias for this table, use the table - // alias instead of the table name. + // If we are aware of a table alias for this table, use the table alias + // instead of the table name. if (isset($left_table) && $left_table['table'] == $extra['table']) { $join_table = $left_table['alias'] . '.'; } @@ -357,8 +349,8 @@ protected function buildExtra($extra, &$arguments, $table, SelectInterface $sele } } - // Convert a single-valued array of values to the single-value case, - // and transform from IN() notation to = notation + // Convert a single-valued array of values to the single-value case, and + // transform from IN() notation to = notation. if (is_array($extra['value']) && count($extra['value']) == 1) { if (empty($extra['operator'])) { $operator = '='; @@ -370,8 +362,8 @@ protected function buildExtra($extra, &$arguments, $table, SelectInterface $sele } if (is_array($extra['value'])) { - // With an array of values, we need multiple placeholders and the - // 'IN' operator is implicit. + // With an array of values, we need multiple placeholders and the 'IN' + // operator is implicit. $local_arguments = array(); foreach ($extra['value'] as $value) { $placeholder_i = ':views_join_condition_' . $select_query->nextPlaceholder(); @@ -387,12 +379,12 @@ protected function buildExtra($extra, &$arguments, $table, SelectInterface $sele $operator = !empty($extra['operator']) ? $extra['operator'] : '='; $placeholder = ':views_join_condition_' . $select_query->nextPlaceholder(); } - // Set 'field' as join table field if available or set 'left field' as - // join table field is not set. + // Set 'field' as join table field if available or set 'left field' as join + // table field is not set. if (isset($extra['field'])) { $join_table_field = "$join_table$extra[field]"; - // Allow the value to be set either with the 'value' element or - // with 'left_field'. + // Allow the value to be set either with the 'value' element or with + // 'left_field'. if (isset($extra['left_field'])) { $placeholder = "$left_table[alias].$extra[left_field]"; } diff --git a/core/modules/views/src/Tests/FieldApiDataTest.php b/core/modules/views/src/Tests/FieldApiDataTest.php index bb77661..053a789 100644 --- a/core/modules/views/src/Tests/FieldApiDataTest.php +++ b/core/modules/views/src/Tests/FieldApiDataTest.php @@ -125,7 +125,7 @@ protected function setUp() { ]); $field->save(); - // Create some example content + // Create some example content. ConfigurableLanguage::create([ 'id' => 'es', ])->save();