summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2018-08-13 10:13:36 (GMT)
committerAlex Pott2018-08-13 10:14:15 (GMT)
commitda3e9773c15de2c40ee0d9c6fbc8b44a7ca5d479 (patch)
tree8b264692026541b127114b9a96ac93781f9d2800
parent43187a5476e4714a3dabe2e53dc1cb77819b8445 (diff)
Issue #2937853 by idebr, mfernea, SherFengChong, alexpott, borisson_: Fix 'Drupal.Formatting.MultipleStatementAlignment' coding standard
(cherry picked from commit 6c40e077ef0ea19231675eca072eca30a6616930)
-rw-r--r--core/includes/theme.inc6
-rw-r--r--core/lib/Drupal/Component/Datetime/DateTimePlus.php2
-rw-r--r--core/lib/Drupal/Core/Asset/CssOptimizer.php2
-rw-r--r--core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php2
-rw-r--r--core/lib/Drupal/Core/Command/DbDumpCommand.php2
-rw-r--r--core/lib/Drupal/Core/Datetime/Element/Datetime.php4
-rw-r--r--core/lib/Drupal/Core/Routing/RouteProvider.php2
-rw-r--r--core/modules/action/tests/src/Functional/ActionListTest.php2
-rw-r--r--core/modules/comment/comment.tokens.inc2
-rw-r--r--core/modules/comment/src/CommentViewsData.php2
-rw-r--r--core/modules/dblog/src/Controller/DbLogController.php2
-rw-r--r--core/modules/file/src/FileViewsData.php2
-rw-r--r--core/modules/file/tests/src/Functional/DownloadTest.php2
-rw-r--r--core/modules/forum/src/Form/ForumForm.php2
-rw-r--r--core/modules/history/history.module2
-rw-r--r--core/modules/history/history.views.inc2
-rw-r--r--core/modules/locale/locale.compare.inc2
-rw-r--r--core/modules/menu_ui/tests/src/Functional/MenuUiTest.php2
-rw-r--r--core/modules/migrate/src/Plugin/MigrationPluginManager.php2
-rw-r--r--core/modules/node/src/NodeTypeForm.php2
-rw-r--r--core/modules/node/src/NodeViewsData.php2
-rw-r--r--core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php8
-rw-r--r--core/modules/serialization/tests/modules/field_normalization_test/src/Normalization/TextItemSillyNormalizer.php2
-rw-r--r--core/modules/statistics/statistics.views.inc2
-rw-r--r--core/modules/system/src/Controller/SystemController.php2
-rw-r--r--core/modules/system/tests/modules/entity_test_update/entity_test_update.module2
-rw-r--r--core/modules/system/tests/src/Functional/System/StatusTest.php2
-rw-r--r--core/modules/taxonomy/src/TermViewsData.php2
-rw-r--r--core/modules/user/src/Plugin/views/field/Roles.php2
-rw-r--r--core/modules/user/user.module2
-rw-r--r--core/modules/views/src/Plugin/views/display/Feed.php2
-rw-r--r--core/modules/views/src/Plugin/views/query/Sql.php2
-rw-r--r--core/modules/views/tests/src/Unit/EntityViewsDataTest.php2
-rw-r--r--core/modules/views/views.theme.inc6
-rw-r--r--core/phpcs.xml.dist1
-rwxr-xr-xcore/scripts/drupal.sh2
-rwxr-xr-xcore/scripts/password-hash.sh2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryCachedTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php2
41 files changed, 49 insertions, 48 deletions
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 5bcc1e2..de21bfe 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -1371,9 +1371,9 @@ function template_preprocess_page(&$variables) {
}
}
- $variables['base_path'] = base_path();
- $variables['front_page'] = \Drupal::url('<front>');
- $variables['language'] = $language_interface;
+ $variables['base_path'] = base_path();
+ $variables['front_page'] = \Drupal::url('<front>');
+ $variables['language'] = $language_interface;
// An exception might be thrown.
try {
diff --git a/core/lib/Drupal/Component/Datetime/DateTimePlus.php b/core/lib/Drupal/Component/Datetime/DateTimePlus.php
index 6c4a3b1..bb56ba5 100644
--- a/core/lib/Drupal/Component/Datetime/DateTimePlus.php
+++ b/core/lib/Drupal/Component/Datetime/DateTimePlus.php
@@ -41,7 +41,7 @@ class DateTimePlus {
use ToStringTrait;
- const FORMAT = 'Y-m-d H:i:s';
+ const FORMAT = 'Y-m-d H:i:s';
/**
* A RFC7231 Compliant date.
diff --git a/core/lib/Drupal/Core/Asset/CssOptimizer.php b/core/lib/Drupal/Core/Asset/CssOptimizer.php
index f20078c..94c2240 100644
--- a/core/lib/Drupal/Core/Asset/CssOptimizer.php
+++ b/core/lib/Drupal/Core/Asset/CssOptimizer.php
@@ -189,7 +189,7 @@ class CssOptimizer implements AssetOptimizerInterface {
if ($optimize) {
// Perform some safe CSS optimizations.
// Regexp to match comment blocks.
- $comment = '/\*[^*]*\*+(?:[^/*][^*]*\*+)*/';
+ $comment = '/\*[^*]*\*+(?:[^/*][^*]*\*+)*/';
// Regexp to match double quoted strings.
$double_quot = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"';
// Regexp to match single quoted strings.
diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php b/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php
index b86390e..6bde00b 100644
--- a/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php
+++ b/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php
@@ -74,7 +74,7 @@ class DatabaseBackendFactory implements CacheFactoryInterface {
$max_rows_settings = $this->settings->get('database_cache_max_rows');
// First, look for a cache bin specific setting.
if (isset($max_rows_settings['bins'][$bin])) {
- $max_rows = $max_rows_settings['bins'][$bin];
+ $max_rows = $max_rows_settings['bins'][$bin];
}
// Second, use configured default backend.
elseif (isset($max_rows_settings['default'])) {
diff --git a/core/lib/Drupal/Core/Command/DbDumpCommand.php b/core/lib/Drupal/Core/Command/DbDumpCommand.php
index a260fff..26b4363 100644
--- a/core/lib/Drupal/Core/Command/DbDumpCommand.php
+++ b/core/lib/Drupal/Core/Command/DbDumpCommand.php
@@ -145,7 +145,7 @@ class DbDumpCommand extends DbCommandBase {
$name = $row['Field'];
// Parse out the field type and meta information.
preg_match('@([a-z]+)(?:\((\d+)(?:,(\d+))?\))?\s*(unsigned)?@', $row['Type'], $matches);
- $type = $this->fieldTypeMap($connection, $matches[1]);
+ $type = $this->fieldTypeMap($connection, $matches[1]);
if ($row['Extra'] === 'auto_increment') {
// If this is an auto increment, then the type is 'serial'.
$type = 'serial';
diff --git a/core/lib/Drupal/Core/Datetime/Element/Datetime.php b/core/lib/Drupal/Core/Datetime/Element/Datetime.php
index 6d39f8d..bfdaa40 100644
--- a/core/lib/Drupal/Core/Datetime/Element/Datetime.php
+++ b/core/lib/Drupal/Core/Datetime/Element/Datetime.php
@@ -70,8 +70,8 @@ class Datetime extends DateElementBase {
*/
public static function valueCallback(&$element, $input, FormStateInterface $form_state) {
if ($input !== FALSE) {
- $date_input = $element['#date_date_element'] != 'none' && !empty($input['date']) ? $input['date'] : '';
- $time_input = $element['#date_time_element'] != 'none' && !empty($input['time']) ? $input['time'] : '';
+ $date_input = $element['#date_date_element'] != 'none' && !empty($input['date']) ? $input['date'] : '';
+ $time_input = $element['#date_time_element'] != 'none' && !empty($input['time']) ? $input['time'] : '';
$date_format = $element['#date_date_element'] != 'none' ? static::getHtml5DateFormat($element) : '';
$time_format = $element['#date_time_element'] != 'none' ? static::getHtml5TimeFormat($element) : '';
$timezone = !empty($element['#date_timezone']) ? $element['#date_timezone'] : NULL;
diff --git a/core/lib/Drupal/Core/Routing/RouteProvider.php b/core/lib/Drupal/Core/Routing/RouteProvider.php
index 26df831..d31f293 100644
--- a/core/lib/Drupal/Core/Routing/RouteProvider.php
+++ b/core/lib/Drupal/Core/Routing/RouteProvider.php
@@ -401,7 +401,7 @@ class RouteProvider implements PreloadableRouteProviderInterface, PagedRouteProv
* {@inheritdoc}
*/
public function reset() {
- $this->routes = [];
+ $this->routes = [];
$this->serializedRoutes = [];
$this->cacheTagInvalidator->invalidateTags(['routes']);
}
diff --git a/core/modules/action/tests/src/Functional/ActionListTest.php b/core/modules/action/tests/src/Functional/ActionListTest.php
index fc67986..28eda68 100644
--- a/core/modules/action/tests/src/Functional/ActionListTest.php
+++ b/core/modules/action/tests/src/Functional/ActionListTest.php
@@ -28,7 +28,7 @@ class ActionListTest extends BrowserTestBase {
// Ensure the empty text appears on the action list page.
/** @var $storage \Drupal\Core\Entity\EntityStorageInterface */
$storage = $this->container->get('entity.manager')->getStorage('action');
- $actions = $storage->loadMultiple();
+ $actions = $storage->loadMultiple();
$storage->delete($actions);
$this->drupalGet('/admin/config/system/actions');
$this->assertRaw('There are no actions yet.');
diff --git a/core/modules/comment/comment.tokens.inc b/core/modules/comment/comment.tokens.inc
index 8841441..e29872f 100644
--- a/core/modules/comment/comment.tokens.inc
+++ b/core/modules/comment/comment.tokens.inc
@@ -179,7 +179,7 @@ function comment_tokens($type, $tokens, array $data, array $options, BubbleableM
// Comment related URLs.
case 'url':
- $url_options['fragment'] = 'comment-' . $comment->id();
+ $url_options['fragment'] = 'comment-' . $comment->id();
$replacements[$original] = $comment->url('canonical', $url_options);
break;
diff --git a/core/modules/comment/src/CommentViewsData.php b/core/modules/comment/src/CommentViewsData.php
index 9a344a6..7fb7421 100644
--- a/core/modules/comment/src/CommentViewsData.php
+++ b/core/modules/comment/src/CommentViewsData.php
@@ -235,7 +235,7 @@ class CommentViewsData extends EntityViewsData {
// Define the base group of this table. Fields that don't have a group defined
// will go into this field by default.
- $data['comment_entity_statistics']['table']['group'] = $this->t('Comment Statistics');
+ $data['comment_entity_statistics']['table']['group'] = $this->t('Comment Statistics');
// Provide a relationship for each entity type except comment.
foreach ($entities_types as $type => $entity_type) {
diff --git a/core/modules/dblog/src/Controller/DbLogController.php b/core/modules/dblog/src/Controller/DbLogController.php
index 21e3dac..9fe2922 100644
--- a/core/modules/dblog/src/Controller/DbLogController.php
+++ b/core/modules/dblog/src/Controller/DbLogController.php
@@ -413,7 +413,7 @@ class DbLogController extends ControllerBase {
}
}
- $build['dblog_top_table'] = [
+ $build['dblog_top_table'] = [
'#type' => 'table',
'#header' => $header,
'#rows' => $rows,
diff --git a/core/modules/file/src/FileViewsData.php b/core/modules/file/src/FileViewsData.php
index 459a37e..aad5ac2 100644
--- a/core/modules/file/src/FileViewsData.php
+++ b/core/modules/file/src/FileViewsData.php
@@ -65,7 +65,7 @@ class FileViewsData extends EntityViewsData {
$data['file_managed']['uid']['relationship']['title'] = $this->t('User who uploaded');
$data['file_managed']['uid']['relationship']['label'] = $this->t('User who uploaded');
- $data['file_usage']['table']['group'] = $this->t('File Usage');
+ $data['file_usage']['table']['group'] = $this->t('File Usage');
// Provide field-type-things to several base tables; on the core files table
// ("file_managed") so that we can create relationships from files to
diff --git a/core/modules/file/tests/src/Functional/DownloadTest.php b/core/modules/file/tests/src/Functional/DownloadTest.php
index 40bc73e..95693ec 100644
--- a/core/modules/file/tests/src/Functional/DownloadTest.php
+++ b/core/modules/file/tests/src/Functional/DownloadTest.php
@@ -62,7 +62,7 @@ class DownloadTest extends FileManagedTestBase {
$file->setPermanent();
$file->save();
- $url = file_create_url($file->getFileUri());
+ $url = file_create_url($file->getFileUri());
// Set file_test access header to allow the download.
file_test_set_return('download', ['x-foo' => 'Bar']);
diff --git a/core/modules/forum/src/Form/ForumForm.php b/core/modules/forum/src/Form/ForumForm.php
index 28030cb..fdee13a 100644
--- a/core/modules/forum/src/Form/ForumForm.php
+++ b/core/modules/forum/src/Form/ForumForm.php
@@ -77,7 +77,7 @@ class ForumForm extends TermForm {
$status = $term_storage->save($term);
$route_name = $this->urlStub == 'container' ? 'entity.taxonomy_term.forum_edit_container_form' : 'entity.taxonomy_term.forum_edit_form';
- $route_parameters = ['taxonomy_term' => $term->id()];
+ $route_parameters = ['taxonomy_term' => $term->id()];
$link = $this->l($this->t('Edit'), new Url($route_name, $route_parameters));
$view_link = $term->link($term->getName());
switch ($status) {
diff --git a/core/modules/history/history.module b/core/modules/history/history.module
index f36121e..fddbe44 100644
--- a/core/modules/history/history.module
+++ b/core/modules/history/history.module
@@ -27,7 +27,7 @@ define('HISTORY_READ_LIMIT', REQUEST_TIME - 30 * 24 * 60 * 60);
function history_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.history':
- $output = '<h3>' . t('About') . '</h3>';
+ $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>';
return $output;
}
diff --git a/core/modules/history/history.views.inc b/core/modules/history/history.views.inc
index a4dcd99..60c95cd 100644
--- a/core/modules/history/history.views.inc
+++ b/core/modules/history/history.views.inc
@@ -14,7 +14,7 @@ function history_views_data() {
// We're actually defining a specific instance of the table, so let's
// alias it so that we can later add the real table for other purposes if we
// need it.
- $data['history']['table']['group'] = t('Content');
+ $data['history']['table']['group'] = t('Content');
// Explain how this table joins to others.
$data['history']['table']['join'] = [
diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc
index c66af14..f6b79f4 100644
--- a/core/modules/locale/locale.compare.inc
+++ b/core/modules/locale/locale.compare.inc
@@ -161,7 +161,7 @@ function locale_translation_default_translation_server() {
// An additional check is required here. During the upgrade process
// \Drupal::config()->get() returns NULL. We use the defined value as
// fallback.
- $pattern = $pattern ? $pattern : LOCALE_TRANSLATION_DEFAULT_SERVER_PATTERN;
+ $pattern = $pattern ? $pattern : LOCALE_TRANSLATION_DEFAULT_SERVER_PATTERN;
return [
'pattern' => $pattern,
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
index 9cd64c0..345b779 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
@@ -662,7 +662,7 @@ class MenuUiTest extends BrowserTestBase {
$this->drupalPostForm("admin/structure/menu/manage/{$this->menu->id()}/add", $edit, t('Save'));
$menu_links = entity_load_multiple_by_properties('menu_link_content', ['title' => $title]);
$last_link = reset($menu_links);
- $created_links[] = 'tools:' . $last_link->getPluginId();
+ $created_links[] = 'tools:' . $last_link->getPluginId();
}
// The last link cannot be a parent in the new menu link form.
diff --git a/core/modules/migrate/src/Plugin/MigrationPluginManager.php b/core/modules/migrate/src/Plugin/MigrationPluginManager.php
index d06341f..dde8a9f 100644
--- a/core/modules/migrate/src/Plugin/MigrationPluginManager.php
+++ b/core/modules/migrate/src/Plugin/MigrationPluginManager.php
@@ -83,7 +83,7 @@ class MigrationPluginManager extends DefaultPluginManager implements MigrationPl
// This gets rid of migrations which try to use a non-existent source
// plugin. The common case for this is if the source plugin has, or
// specifies, a non-existent provider.
- $only_with_source_discovery = new NoSourcePluginDecorator($yaml_discovery);
+ $only_with_source_discovery = new NoSourcePluginDecorator($yaml_discovery);
// This gets rid of migrations with explicit providers set if one of the
// providers do not exist before we try to use a potentially non-existing
// deriver. This is a rare case.
diff --git a/core/modules/node/src/NodeTypeForm.php b/core/modules/node/src/NodeTypeForm.php
index 148c1ff..23fbe34 100644
--- a/core/modules/node/src/NodeTypeForm.php
+++ b/core/modules/node/src/NodeTypeForm.php
@@ -124,7 +124,7 @@ class NodeTypeForm extends BundleEntityFormBase {
DRUPAL_REQUIRED => t('Required'),
],
];
- $form['submission']['help'] = [
+ $form['submission']['help'] = [
'#type' => 'textarea',
'#title' => t('Explanation or submission guidelines'),
'#default_value' => $type->getHelp(),
diff --git a/core/modules/node/src/NodeViewsData.php b/core/modules/node/src/NodeViewsData.php
index e13e76c..2e09564 100644
--- a/core/modules/node/src/NodeViewsData.php
+++ b/core/modules/node/src/NodeViewsData.php
@@ -280,7 +280,7 @@ class NodeViewsData extends EntityViewsData {
// Define the base group of this table. Fields that don't have a group defined
// will go into this field by default.
- $data['node_access']['table']['group'] = $this->t('Content access');
+ $data['node_access']['table']['group'] = $this->t('Content access');
// For other base tables, explain how we join.
$data['node_access']['table']['join'] = [
diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
index 6f84d7e..18bf11b 100644
--- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
+++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
@@ -789,7 +789,7 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
// Try with all of the following request bodies.
$unparseable_request_body = '!{>}<';
- $parseable_valid_request_body = $this->serializer->encode($this->getNormalizedPostEntity(), static::$format);
+ $parseable_valid_request_body = $this->serializer->encode($this->getNormalizedPostEntity(), static::$format);
$parseable_valid_request_body_2 = $this->serializer->encode($this->getSecondNormalizedPostEntity(), static::$format);
$parseable_invalid_request_body = $this->serializer->encode($this->makeNormalizationInvalid($this->getNormalizedPostEntity(), 'label'), static::$format);
$parseable_invalid_request_body_2 = $this->serializer->encode($this->getNormalizedPostEntity() + ['uuid' => [$this->randomMachineName(129)]], static::$format);
@@ -1018,9 +1018,9 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$has_canonical_url = $this->entity->hasLinkTemplate('canonical');
// Try with all of the following request bodies.
- $unparseable_request_body = '!{>}<';
- $parseable_valid_request_body = $this->serializer->encode($this->getNormalizedPatchEntity(), static::$format);
- $parseable_valid_request_body_2 = $this->serializer->encode($this->getNormalizedPatchEntity(), static::$format);
+ $unparseable_request_body = '!{>}<';
+ $parseable_valid_request_body = $this->serializer->encode($this->getNormalizedPatchEntity(), static::$format);
+ $parseable_valid_request_body_2 = $this->serializer->encode($this->getNormalizedPatchEntity(), static::$format);
$parseable_invalid_request_body = $this->serializer->encode($this->makeNormalizationInvalid($this->getNormalizedPatchEntity(), 'label'), static::$format);
$parseable_invalid_request_body_2 = $this->serializer->encode($this->getNormalizedPatchEntity() + ['field_rest_test' => [['value' => $this->randomString()]]], static::$format);
// The 'field_rest_test' field does not allow 'view' access, so does not end
diff --git a/core/modules/serialization/tests/modules/field_normalization_test/src/Normalization/TextItemSillyNormalizer.php b/core/modules/serialization/tests/modules/field_normalization_test/src/Normalization/TextItemSillyNormalizer.php
index 45438f4..88f2414 100644
--- a/core/modules/serialization/tests/modules/field_normalization_test/src/Normalization/TextItemSillyNormalizer.php
+++ b/core/modules/serialization/tests/modules/field_normalization_test/src/Normalization/TextItemSillyNormalizer.php
@@ -29,7 +29,7 @@ class TextItemSillyNormalizer extends FieldItemNormalizer {
*/
protected function constructValue($data, $context) {
$value = parent::constructValue($data, $context);
- $value['value'] = str_replace('::silly_suffix', '', $value['value']);
+ $value['value'] = str_replace('::silly_suffix', '', $value['value']);
return $value;
}
diff --git a/core/modules/statistics/statistics.views.inc b/core/modules/statistics/statistics.views.inc
index 03e73ff..e9ce164 100644
--- a/core/modules/statistics/statistics.views.inc
+++ b/core/modules/statistics/statistics.views.inc
@@ -9,7 +9,7 @@
* Implements hook_views_data().
*/
function statistics_views_data() {
- $data['node_counter']['table']['group'] = t('Content statistics');
+ $data['node_counter']['table']['group'] = t('Content statistics');
$data['node_counter']['table']['join'] = [
'node_field_data' => [
diff --git a/core/modules/system/src/Controller/SystemController.php b/core/modules/system/src/Controller/SystemController.php
index 42b50d0..106f4e2 100644
--- a/core/modules/system/src/Controller/SystemController.php
+++ b/core/modules/system/src/Controller/SystemController.php
@@ -187,7 +187,7 @@ class SystemController extends ControllerBase {
uasort($themes, 'system_sort_modules_by_info_name');
$theme_default = $config->get('default');
- $theme_groups = ['installed' => [], 'uninstalled' => []];
+ $theme_groups = ['installed' => [], 'uninstalled' => []];
$admin_theme = $config->get('admin');
$admin_theme_options = [];
diff --git a/core/modules/system/tests/modules/entity_test_update/entity_test_update.module b/core/modules/system/tests/modules/entity_test_update/entity_test_update.module
index bd674dd..dbcebf0 100644
--- a/core/modules/system/tests/modules/entity_test_update/entity_test_update.module
+++ b/core/modules/system/tests/modules/entity_test_update/entity_test_update.module
@@ -99,7 +99,7 @@ function entity_test_update_entity_presave(EntityInterface $entity) {
*/
function _entity_test_update_create_test_entities($start = 1, $end = 50, $add_translation = FALSE) {
for ($i = $start; $i <= $end; $i++) {
- $entity = EntityTestUpdate::create([
+ $entity = EntityTestUpdate::create([
'id' => $i,
'name' => $i,
'test_single_property' => $i . ' - test single property',
diff --git a/core/modules/system/tests/src/Functional/System/StatusTest.php b/core/modules/system/tests/src/Functional/System/StatusTest.php
index 1ec4fb5..c902a37 100644
--- a/core/modules/system/tests/src/Functional/System/StatusTest.php
+++ b/core/modules/system/tests/src/Functional/System/StatusTest.php
@@ -27,7 +27,7 @@ class StatusTest extends BrowserTestBase {
// Unset the sync directory in settings.php to trigger $config_directories
// error.
- $settings['config_directories'] = [
+ $settings['config_directories'] = [
CONFIG_SYNC_DIRECTORY => (object) [
'value' => '',
'required' => TRUE,
diff --git a/core/modules/taxonomy/src/TermViewsData.php b/core/modules/taxonomy/src/TermViewsData.php
index 6cade9a..73e8cbc 100644
--- a/core/modules/taxonomy/src/TermViewsData.php
+++ b/core/modules/taxonomy/src/TermViewsData.php
@@ -133,7 +133,7 @@ class TermViewsData extends EntityViewsData {
],
];
- $data['taxonomy_index']['table']['group'] = $this->t('Taxonomy term');
+ $data['taxonomy_index']['table']['group'] = $this->t('Taxonomy term');
$data['taxonomy_index']['table']['join'] = [
'taxonomy_term_field_data' => [
diff --git a/core/modules/user/src/Plugin/views/field/Roles.php b/core/modules/user/src/Plugin/views/field/Roles.php
index 1fc99c7..eec26f8 100644
--- a/core/modules/user/src/Plugin/views/field/Roles.php
+++ b/core/modules/user/src/Plugin/views/field/Roles.php
@@ -82,7 +82,7 @@ class Roles extends PrerenderList {
$ordered_roles = array_flip(array_keys($roles));
foreach ($this->items as &$user_roles) {
// Create an array of rids that the user has in the role weight order.
- $sorted_keys = array_intersect_key($ordered_roles, $user_roles);
+ $sorted_keys = array_intersect_key($ordered_roles, $user_roles);
// Merge with the unsorted array of role information which has the
// effect of sorting it.
$user_roles = array_merge($sorted_keys, $user_roles);
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index a2b6464..b18408a 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -491,7 +491,7 @@ function template_preprocess_username(&$variables) {
// unsanitized version, in case other preprocess functions want to implement
// their own shortening logic or add markup. If they do so, they must ensure
// that $variables['name'] is safe for printing.
- $name = $account->getDisplayName();
+ $name = $account->getDisplayName();
$variables['name_raw'] = $account->getUsername();
if (mb_strlen($name) > 20) {
$name = Unicode::truncate($name, 15, FALSE, TRUE);
diff --git a/core/modules/views/src/Plugin/views/display/Feed.php b/core/modules/views/src/Plugin/views/display/Feed.php
index db1bc1c..05169b9 100644
--- a/core/modules/views/src/Plugin/views/display/Feed.php
+++ b/core/modules/views/src/Plugin/views/display/Feed.php
@@ -140,7 +140,7 @@ class Feed extends PathPluginBase implements ResponseDisplayPluginInterface {
// Overrides for standard stuff.
$options['style']['contains']['type']['default'] = 'rss';
- $options['style']['contains']['options']['default'] = ['description' => ''];
+ $options['style']['contains']['options']['default'] = ['description' => ''];
$options['sitename_title']['default'] = FALSE;
$options['row']['contains']['type']['default'] = 'rss_fields';
$options['defaults']['default']['style'] = FALSE;
diff --git a/core/modules/views/src/Plugin/views/query/Sql.php b/core/modules/views/src/Plugin/views/query/Sql.php
index 99d0aa8..03749a3 100644
--- a/core/modules/views/src/Plugin/views/query/Sql.php
+++ b/core/modules/views/src/Plugin/views/query/Sql.php
@@ -1513,7 +1513,7 @@ class Sql extends QueryPluginBase {
if (!empty($this->limit) || !empty($this->offset)) {
// We can't have an offset without a limit, so provide a very large limit instead.
- $limit = intval(!empty($this->limit) ? $this->limit : 999999);
+ $limit = intval(!empty($this->limit) ? $this->limit : 999999);
$offset = intval(!empty($this->offset) ? $this->offset : 0);
$query->range($offset, $limit);
}
diff --git a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
index 956f7dc..c1d0cdf 100644
--- a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
+++ b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
@@ -176,7 +176,7 @@ class EntityViewsDataTest extends UnitTestCase {
->setSetting('max_length', 255);
// A base field with cardinality > 1
- $base_fields['string'] = BaseFieldDefinition::create('string')
+ $base_fields['string'] = BaseFieldDefinition::create('string')
->setLabel('Strong')
->setTranslatable(TRUE)
->setCardinality(2);
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc
index 6028f3d..cb9aee7 100644
--- a/core/modules/views/views.theme.inc
+++ b/core/modules/views/views.theme.inc
@@ -811,7 +811,7 @@ function template_preprocess_views_view_unformatted(&$variables) {
* - view: A View object.
*/
function template_preprocess_views_view_list(&$variables) {
- $handler = $variables['view']->style_plugin;
+ $handler = $variables['view']->style_plugin;
// Fetch classes from handler options.
if ($handler->options['class']) {
@@ -844,7 +844,7 @@ function template_preprocess_views_view_list(&$variables) {
* - 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;
@@ -945,7 +945,7 @@ function template_preprocess_views_view_row_rss(&$variables) {
* - rows: The raw row data.
*/
function template_preprocess_views_view_opml(&$variables) {
- $view = $variables['view'];
+ $view = $variables['view'];
$items = $variables['rows'];
$config = \Drupal::config('system.site');
diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist
index 3011844..2427d34 100644
--- a/core/phpcs.xml.dist
+++ b/core/phpcs.xml.dist
@@ -99,6 +99,7 @@
<rule ref="Drupal.Files.FileEncoding"/>
<rule ref="Drupal.Files.TxtFileLineLength"/>
<rule ref="Drupal.Formatting.MultiLineAssignment"/>
+ <rule ref="Drupal.Formatting.MultipleStatementAlignment"/>
<rule ref="Drupal.Formatting.SpaceInlineIf"/>
<rule ref="Drupal.Formatting.SpaceUnaryOperator"/>
<rule ref="Drupal.Functions.DiscouragedFunctions"/>
diff --git a/core/scripts/drupal.sh b/core/scripts/drupal.sh
index 904c9ce..d0b9f3d 100755
--- a/core/scripts/drupal.sh
+++ b/core/scripts/drupal.sh
@@ -58,8 +58,8 @@ EOF;
exit;
}
-// define default settings
$cmd = 'index.php';
+// define default settings
$_SERVER['HTTP_HOST'] = 'default';
$_SERVER['PHP_SELF'] = '/index.php';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
diff --git a/core/scripts/password-hash.sh b/core/scripts/password-hash.sh
index 611ee53..18d057a 100755
--- a/core/scripts/password-hash.sh
+++ b/core/scripts/password-hash.sh
@@ -17,7 +17,7 @@ if (PHP_SAPI !== 'cli') {
}
if (version_compare(PHP_VERSION, '5.4.5') < 0) {
- $version = PHP_VERSION;
+ $version = PHP_VERSION;
echo <<<EOF
ERROR: This script requires at least PHP version 5.4.5. You invoked it with
diff --git a/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php b/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php
index 2a9ea0b..fff73c2 100644
--- a/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php
@@ -204,7 +204,7 @@ class AttachedAssetsTest extends KernelTestBase {
$end = strrpos($rendered_js, $endToken);
// Convert to a string, as $renderer_js is a \Drupal\Core\Render\Markup
// object.
- $json = mb_substr($rendered_js, $start, $end - $start + 1);
+ $json = mb_substr($rendered_js, $start, $end - $start + 1);
$parsed_settings = Json::decode($json);
// Test whether the settings for core/drupalSettings are available.
diff --git a/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php b/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php
index 5c31dc6..dba742d 100644
--- a/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php
@@ -31,7 +31,7 @@ class ToolkitGdTest extends KernelTestBase {
protected $white = [255, 255, 255, 0];
protected $transparent = [0, 0, 0, 127];
// Used as rotate background colors.
- protected $fuchsia = [255, 0, 255, 0];
+ protected $fuchsia = [255, 0, 255, 0];
protected $rotateTransparent = [255, 255, 255, 127];
protected $width = 40;
diff --git a/core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryCachedTest.php b/core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryCachedTest.php
index e19c557..61f7069 100644
--- a/core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryCachedTest.php
+++ b/core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryCachedTest.php
@@ -31,7 +31,7 @@ class AnnotatedClassDiscoveryCachedTest extends TestCase {
*/
public function testGetDefinitions() {
// Path to the classes which we'll discover and parse annotation.
- $discovery_path = __DIR__ . '/Fixtures';
+ $discovery_path = __DIR__ . '/Fixtures';
// File path that should be discovered within that directory.
$file_path = $discovery_path . '/PluginNamespace/DiscoveryTest1.php';
diff --git a/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php b/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php
index 70cbd4a..7a56abb 100644
--- a/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php
@@ -61,7 +61,7 @@ class ArgumentsResolverTest extends TestCase {
// Test with a raw value that overrides the provided upcast value, since
// it is not typehinted.
- $scalars = ['foo' => 'baz'];
+ $scalars = ['foo' => 'baz'];
$objects = ['foo' => new \stdClass()];
$data[] = [
function ($foo) {}, $scalars, $objects, [], ['baz'],