diff --git a/core/authorize.php b/core/authorize.php index 18db5ca..211a1c4 100644 --- a/core/authorize.php +++ b/core/authorize.php @@ -147,10 +147,10 @@ function authorize_access_allowed(Request $request) { ], ]; } - $heading = array( + $heading = [ 'text' => t('Next steps'), 'level' => 'h3', - ); + ]; $content['next_steps'] = array( '#theme' => 'item_list', '#items' => $links, diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 133fa3e..2410b4e 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -186,40 +186,37 @@ function node_entity_view_display_alter(EntityViewDisplayInterface $display, $co * $result, or FALSE if there are no rows in $result. */ function node_title_list(StatementInterface $result, $title = NULL) { - $links = array(); + $links = []; $has_rows = FALSE; $nids = []; foreach ($result as $row) { // Do not use $node->label() or $node->urlInfo() here, because we only have // database rows, not actual nodes. $nids[] = $row->nid; - $options = !empty($row->comment_count) ? array( - 'title' => \Drupal::translation() - ->formatPlural($row->comment_count, '1 comment', '@count comments') - ) : array(); - $links[] = array( + $options = !empty($row->comment_count) ? [ + 'title' => \Drupal::translation()->formatPlural($row->comment_count, '1 comment', '@count comments'), + ] : []; + $links[] = [ 'title' => $row->title, 'url' => new Url('entity.node.canonical', ['node' => $row->nid]), 'attributes' => $options, - ); + ]; $has_rows = TRUE; } if ($has_rows) { - $heading = array( + $heading = [ 'text' => $title, 'level' => 'h3', - ); - return array( + ]; + return [ '#theme' => 'links__node', '#links' => $links, - '#heading' => $heading - ); + '#heading' => $heading, + ]; } else { return FALSE; } - - return $num_rows ? array('#theme' => 'item_list__node', '#items' => $items, '#title' => $title, '#cache' => ['tags' => Cache::mergeTags(['node_list'], Cache::buildTags('node', $nids))]) : FALSE; } /** diff --git a/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module b/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module index b779839..acfa3b1 100644 --- a/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module +++ b/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module @@ -36,17 +36,17 @@ function toolbar_test_toolbar() { array( 'title' => t('link 1'), 'href' => '', - 'attributes' => array('title' => 'Test link 1 title') + 'attributes' => array('title' => 'Test link 1 title'), ), array( 'title' => t('link 2'), 'href' => '', - 'attributes' => array('title' => 'Test link 2 title') + 'attributes' => array('title' => 'Test link 2 title'), ), array( 'title' => t('link 3'), 'href' => '', - 'attributes' => array('title' => 'Test link 3 title') + 'attributes' => array('title' => 'Test link 3 title'), ), ), '#heading' => array(