Commit 72d65cc8 authored by xjm's avatar xjm

Issue #2857822 by alexpott, klausi: Fix coding standards issues introduced...

Issue #2857822 by alexpott, klausi: Fix coding standards issues introduced mostly by array syntax conversion
parent 52e3eec6
......@@ -102,7 +102,7 @@ public function providerTestGetBookParents() {
// Provides a book with an existing parent.
[
['pid' => 11, 'nid' => 12],
['nid' => 11, 'depth' => 1, 'p1' => 11,],
['nid' => 11, 'depth' => 1, 'p1' => 11],
['depth' => 2, 'p1' => 11, 'p2' => 12] + $empty,
],
// Provides a book with two existing parents.
......
......@@ -48,7 +48,7 @@ public function getBookAdminRoutes() {
*/
public function testBookNodeLocalTasks($route) {
$this->assertLocalTasks($route, [
0 => ['entity.node.book_outline_form', 'entity.node.canonical', 'entity.node.edit_form', 'entity.node.delete_form', 'entity.node.version_history',],
0 => ['entity.node.book_outline_form', 'entity.node.canonical', 'entity.node.edit_form', 'entity.node.delete_form', 'entity.node.version_history'],
]);
}
......
......@@ -109,23 +109,23 @@ public function getDefaultSettings() {
[
[
'name' => $this->t('Formatting'),
'items' => ['Bold', 'Italic',],
'items' => ['Bold', 'Italic'],
],
[
'name' => $this->t('Links'),
'items' => ['DrupalLink', 'DrupalUnlink',],
'items' => ['DrupalLink', 'DrupalUnlink'],
],
[
'name' => $this->t('Lists'),
'items' => ['BulletedList', 'NumberedList',],
'items' => ['BulletedList', 'NumberedList'],
],
[
'name' => $this->t('Media'),
'items' => ['Blockquote', 'DrupalImage',],
'items' => ['Blockquote', 'DrupalImage'],
],
[
'name' => $this->t('Tools'),
'items' => ['Source',],
'items' => ['Source'],
],
],
],
......
......@@ -84,23 +84,23 @@ function testExistingFormat() {
[
[
'name' => 'Formatting',
'items' => ['Bold', 'Italic',],
'items' => ['Bold', 'Italic'],
],
[
'name' => 'Links',
'items' => ['DrupalLink', 'DrupalUnlink',],
'items' => ['DrupalLink', 'DrupalUnlink'],
],
[
'name' => 'Lists',
'items' => ['BulletedList', 'NumberedList',],
'items' => ['BulletedList', 'NumberedList'],
],
[
'name' => 'Media',
'items' => ['Blockquote', 'DrupalImage',],
'items' => ['Blockquote', 'DrupalImage'],
],
[
'name' => 'Tools',
'items' => ['Source',],
'items' => ['Source'],
],
],
],
......
......@@ -463,23 +463,23 @@ protected function getDefaultToolbarConfig() {
return [
[
'name' => 'Formatting',
'items' => ['Bold', 'Italic',],
'items' => ['Bold', 'Italic'],
],
[
'name' => 'Links',
'items' => ['DrupalLink', 'DrupalUnlink',],
'items' => ['DrupalLink', 'DrupalUnlink'],
],
[
'name' => 'Lists',
'items' => ['BulletedList', 'NumberedList',],
'items' => ['BulletedList', 'NumberedList'],
],
[
'name' => 'Media',
'items' => ['Blockquote', 'DrupalImage',],
'items' => ['Blockquote', 'DrupalImage'],
],
[
'name' => 'Tools',
'items' => ['Source',],
'items' => ['Source', ],
],
'/',
];
......
......@@ -51,7 +51,7 @@ function testList() {
// Test getOperations() method.
$expected_operations = [
'edit' => [
'edit' => [
'title' => t('Edit'),
'weight' => 10,
'url' => $entity->urlInfo(),
......@@ -61,7 +61,7 @@ function testList() {
'weight' => 40,
'url' => $entity->urlInfo('disable'),
],
'delete' => [
'delete' => [
'title' => t('Delete'),
'weight' => 100,
'url' => $entity->urlInfo('delete-form'),
......
......@@ -112,7 +112,7 @@ public function testEntityCountAndHasData() {
$entity_init = $this->container->get('entity_type.manager')
->getStorage($entity_type)
->create(['type' => $entity_type,]);
->create(['type' => $entity_type]);
$cardinality = $this->fieldTestData->field_storage_2->getCardinality();
$this->assertIdentical($this->fieldTestData->field_storage_2->hasData(), FALSE, 'There are no entities with field data.');
......
......@@ -138,7 +138,7 @@ public function testEntityDisplaySettings() {
$this->assertIdentical($expected, $component);
// Test date field.
$defaults = ['format_type' => 'fallback', 'timezone_override' => '',];
$defaults = ['format_type' => 'fallback', 'timezone_override' => ''];
$expected['weight'] = 10;
$expected['type'] = 'datetime_default';
$expected['settings'] = ['format_type' => 'fallback'] + $defaults;
......
......@@ -87,7 +87,7 @@ function testFormatterUI() {
$options = array_map(function($item) {
return (string) $item->attributes()->value[0];
}, $result);
$expected_options = [
$expected_options = [
'field_no_settings',
'field_empty_test',
'field_empty_setting',
......@@ -249,7 +249,7 @@ public function testWidgetUI() {
$options = array_map(function($item) {
return (string) $item->attributes()->value[0];
}, $result);
$expected_options = [
$expected_options = [
'test_field_widget',
'test_field_widget_multiple',
];
......
......@@ -129,7 +129,7 @@ public function testEntityDisplayCRUDSort() {
$display->save();
$components = array_keys($display->getComponents());
// The name field is not configurable so will be added automatically.
$expected = [ 0 => 'component_1', 1 => 'component_2', 2 => 'component_3', 'name'];
$expected = [ 0 => 'component_1', 1 => 'component_2', 2 => 'component_3', 'name'];
$this->assertIdentical($components, $expected);
}
......
......@@ -28,7 +28,7 @@ function history_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.history':
$output = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The History module keeps track of which content a user has read. It marks content as <em>new</em> or <em>updated</em> depending on the last time the user viewed it. History records that are older than one month are removed during cron, which means that content older than one month is always considered <em>read</em>. The History module does not have a user interface but it provides a filter to <a href=":views-help">Views</a> to show new or updated content. For more information, see the <a href=":url">online documentation for the History module</a>.', [':views-help' => (\Drupal::moduleHandler()->moduleExists('views')) ? \Drupal::url('help.page', ['name' => 'views']) : '#', ':url' => 'https://www.drupal.org/documentation/modules/history']) . '</p>';
$output .= '<p>' . t('The History module keeps track of which content a user has read. It marks content as <em>new</em> or <em>updated</em> depending on the last time the user viewed it. History records that are older than one month are removed during cron, which means that content older than one month is always considered <em>read</em>. The History module does not have a user interface but it provides a filter to <a href=":views-help">Views</a> to show new or updated content. For more information, see the <a href=":url">online documentation for the History module</a>.', [':views-help' => (\Drupal::moduleHandler()->moduleExists('views')) ? \Drupal::url('help.page', ['name' => 'views']) : '#', ':url' => 'https://www.drupal.org/documentation/modules/history']) . '</p>';
return $output;
}
}
......
......@@ -216,7 +216,7 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
$element[$delta]['#url'] = $url;
if (!empty($item->_attributes)) {
$element[$delta]['#options'] += ['attributes' => []];
$element[$delta]['#options'] += ['attributes' => []];
$element[$delta]['#options']['attributes'] += $item->_attributes;
// Unset field item attributes since they have been included in the
// formatter output and should not be rendered in the field template.
......
......@@ -26,7 +26,7 @@ protected function setUp() {
*/
public function testShortcutPageLocalTasks($route) {
$tasks = [
0 => ['shortcut.set_switch', 'entity.user.canonical', 'entity.user.edit_form',],
0 => ['shortcut.set_switch', 'entity.user.canonical', 'entity.user.edit_form'],
];
$this->assertLocalTasks($route, $tasks);
}
......
......@@ -127,7 +127,7 @@ function system_requirements($phase) {
}
if ($rewrite_warning) {
$requirements['apache_version'] = [
$requirements['apache_version'] = [
'title' => t('Apache version'),
'value' => $apache_version_string,
'severity' => REQUIREMENT_WARNING,
......@@ -136,7 +136,7 @@ function system_requirements($phase) {
}
if ($rewrite_error) {
$requirements['Apache version'] = [
$requirements['Apache version'] = [
'title' => t('Apache version'),
'value' => $apache_version_string,
'severity' => REQUIREMENT_ERROR,
......@@ -145,7 +145,7 @@ function system_requirements($phase) {
}
if (!$rewrite_error && !$rewrite_warning) {
$requirements['rewrite_module'] = [
$requirements['rewrite_module'] = [
'title' => t('Clean URLs'),
'value' => t('Disabled'),
'severity' => REQUIREMENT_WARNING,
......
......@@ -179,7 +179,7 @@ function testUserRoleUpdateSubtreesHashCacheClear() {
$this->hash = $this->getSubtreesHash();
$rid = $this->drupalCreateRole(['administer content types',]);
$rid = $this->drupalCreateRole(['administer content types']);
// Assign the role to the user.
$this->drupalPostForm('user/' . $this->adminUser->id() . '/edit', ["roles[$rid]" => $rid], t('Save'));
......@@ -214,7 +214,7 @@ function testNonCurrentUserAccountUpdates() {
// adminUser2 will add a role to adminUser.
$this->drupalLogin($this->adminUser2);
$rid = $this->drupalCreateRole(['administer content types',]);
$rid = $this->drupalCreateRole(['administer content types']);
// Get the subtree hash for adminUser2 to check later that it has not
// changed. Request a new page to refresh the drupalSettings object.
......
......@@ -150,7 +150,7 @@ function _update_manager_check_backends(&$form, $operation) {
function update_manager_archive_extract($file, $directory) {
$archiver = archiver_get_archiver($file);
if (!$archiver) {
throw new Exception(t('Cannot extract %file, not a valid archive.', ['%file' => $file]));
throw new Exception(t('Cannot extract %file, not a valid archive.', ['%file' => $file]));
}
// Remove the directory if it exists, otherwise it might contain a mixture of
......
......@@ -455,7 +455,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
// @todo: A default value of NULL is ignored, so we have to specify
// an empty field item structure instead. Fix this in
// https://www.drupal.org/node/2318605.
->setDefaultValue([0 => ['value' => NULL]])
->setDefaultValue([0 => ['value' => NULL]])
// @todo: Define this via an options provider once
// https://www.drupal.org/node/2329937 is completed.
->addPropertyConstraints('value', [
......
......@@ -44,7 +44,7 @@ public function getUserAdminRoutes() {
*/
public function testUserLoginLocalTasks($route) {
$tasks = [
0 => ['user.register', 'user.pass', 'user.login',],
0 => ['user.register', 'user.pass', 'user.login'],
];
$this->assertLocalTasks($route, $tasks);
}
......@@ -67,7 +67,7 @@ public function getUserLoginRoutes() {
*/
public function testUserPageLocalTasks($route, $subtask = []) {
$tasks = [
0 => ['entity.user.canonical', 'entity.user.edit_form',],
0 => ['entity.user.canonical', 'entity.user.edit_form'],
];
if ($subtask) $tasks[] = $subtask;
$this->assertLocalTasks($route, $tasks);
......
......@@ -781,7 +781,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
':input[name="options[alter][make_link]"]' => ['checked' => TRUE],
],
],
'#options' => [
'#options' => [
'none' => $this->t('No transform'),
'upper' => $this->t('Upper case'),
'lower' => $this->t('Lower case'),
......
......@@ -26,7 +26,7 @@ class ViewsHooksTest extends ViewsKernelTestBase {
*
* @var array
*/
protected static $hooks = [
protected static $hooks = [
'views_data' => 'all',
'views_data_alter' => 'alter',
'views_query_substitutions' => 'view',
......
......@@ -342,7 +342,7 @@ public function testConfigSaveWithSchema() {
],
'float' => '3.14',
'null_float' => '',
'sequence' => [1, 0, 1],
'sequence' => [1, 0, 1],
'sequence_bc' => [1, 0, 1],
// Not in schema and therefore should be left untouched.
'not_present_in_schema' => TRUE,
......@@ -365,7 +365,7 @@ public function testConfigSaveWithSchema() {
],
'float' => 3.14,
'null_float' => NULL,
'sequence' => [TRUE, FALSE, TRUE],
'sequence' => [TRUE, FALSE, TRUE],
'sequence_bc' => [TRUE, FALSE, TRUE],
'not_present_in_schema' => TRUE,
'config_schema_test_integer' => 1,
......
......@@ -279,7 +279,7 @@ public function providerTestPluralsFormula() {
193 => 1,
194 => 1,
'default' => 2,
],],
], ],
[
'nplurals=4; plural=(((n==1)||(n==11))?(0):(((n==2)||(n==12))?(1):(((n>2)&&(n<20))?(2):3)));',
[
......
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