Issue #2857822 by alexpott, klausi: Fix coding standards issues introduced mostly by array syntax conversion

8.4.x
xjm 2017-03-04 08:02:01 -06:00
parent 52e3eec616
commit 72d65cc85c
22 changed files with 41 additions and 41 deletions

View File

@ -102,7 +102,7 @@ class BookManagerTest extends UnitTestCase {
// 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.

View File

@ -48,7 +48,7 @@ class BookLocalTasksTest extends LocalTaskIntegrationTestBase {
*/
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'],
]);
}

View File

@ -109,23 +109,23 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface {
[
[
'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'],
],
],
],

View File

@ -84,23 +84,23 @@ class CKEditorAdminTest extends WebTestBase {
[
[
'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'],
],
],
],

View File

@ -463,23 +463,23 @@ class CKEditorTest extends KernelTestBase {
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', ],
],
'/',
];

View File

@ -51,7 +51,7 @@ class ConfigEntityListTest extends WebTestBase {
// Test getOperations() method.
$expected_operations = [
'edit' => [
'edit' => [
'title' => t('Edit'),
'weight' => 10,
'url' => $entity->urlInfo(),
@ -61,7 +61,7 @@ class ConfigEntityListTest extends WebTestBase {
'weight' => 40,
'url' => $entity->urlInfo('disable'),
],
'delete' => [
'delete' => [
'title' => t('Delete'),
'weight' => 100,
'url' => $entity->urlInfo('delete-form'),

View File

@ -112,7 +112,7 @@ class FieldDataCountTest extends FieldKernelTestBase {
$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.');

View File

@ -138,7 +138,7 @@ class MigrateFieldFormatterSettingsTest extends MigrateDrupal6TestBase {
$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;

View File

@ -87,7 +87,7 @@ class ManageDisplayTest extends WebTestBase {
$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 @@ class ManageDisplayTest extends WebTestBase {
$options = array_map(function($item) {
return (string) $item->attributes()->value[0];
}, $result);
$expected_options = [
$expected_options = [
'test_field_widget',
'test_field_widget_multiple',
];

View File

@ -129,7 +129,7 @@ class EntityDisplayTest extends KernelTestBase {
$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);
}

View File

@ -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;
}
}

View File

@ -216,7 +216,7 @@ class LinkFormatter extends FormatterBase implements ContainerFactoryPluginInter
$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.

View File

@ -26,7 +26,7 @@ class ShortcutLocalTasksTest extends LocalTaskIntegrationTestBase {
*/
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);
}

View File

@ -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,

View File

@ -179,7 +179,7 @@ class ToolbarAdminMenuTest extends WebTestBase {
$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 @@ class ToolbarAdminMenuTest extends WebTestBase {
// 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.

View File

@ -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

View File

@ -455,7 +455,7 @@ class User extends ContentEntityBase implements UserInterface {
// @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', [

View File

@ -44,7 +44,7 @@ class UserLocalTasksTest extends LocalTaskIntegrationTestBase {
*/
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 @@ class UserLocalTasksTest extends LocalTaskIntegrationTestBase {
*/
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);

View File

@ -781,7 +781,7 @@ abstract class FieldPluginBase extends HandlerBase implements FieldHandlerInterf
':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'),

View File

@ -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',

View File

@ -342,7 +342,7 @@ class ConfigSchemaTest extends KernelTestBase {
],
'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 @@ class ConfigSchemaTest extends KernelTestBase {
],
'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,

View File

@ -279,7 +279,7 @@ class PoHeaderTest extends UnitTestCase {
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)));',
[