diff --git a/core/lib/Drupal/Component/DependencyInjection/Container.php b/core/lib/Drupal/Component/DependencyInjection/Container.php
index 45cc8b93ed..2409ba5207 100644
--- a/core/lib/Drupal/Component/DependencyInjection/Container.php
+++ b/core/lib/Drupal/Component/DependencyInjection/Container.php
@@ -586,8 +586,6 @@ public function getServiceIds() {
/**
* Ensure that cloning doesn't work.
*/
- private function __clone()
- {
- }
+ private function __clone() {}
}
diff --git a/core/lib/Drupal/Core/Config/DatabaseStorage.php b/core/lib/Drupal/Core/Config/DatabaseStorage.php
index 5d88f1576e..15f27cf661 100644
--- a/core/lib/Drupal/Core/Config/DatabaseStorage.php
+++ b/core/lib/Drupal/Core/Config/DatabaseStorage.php
@@ -159,7 +159,7 @@ protected function doWrite($name, $data) {
* @throws \Drupal\Core\Config\StorageException
* If a database error occurs.
*/
- protected function ensureTableExists() {
+ protected function ensureTableExists() {
try {
if (!$this->connection->schema()->tableExists($this->table)) {
$this->connection->schema()->createTable($this->table, static::schemaDefinition());
diff --git a/core/lib/Drupal/Core/Form/FormStateDecoratorBase.php b/core/lib/Drupal/Core/Form/FormStateDecoratorBase.php
index c063666464..2668f59a41 100644
--- a/core/lib/Drupal/Core/Form/FormStateDecoratorBase.php
+++ b/core/lib/Drupal/Core/Form/FormStateDecoratorBase.php
@@ -557,7 +557,7 @@ public function hasValue($key) {
/**
* {@inheritdoc}
*/
- public function isValueEmpty($key) {
+ public function isValueEmpty($key) {
return $this->decoratedFormState->isValueEmpty($key);
}
diff --git a/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php b/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php
index 926723702d..56c0339bd6 100644
--- a/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php
+++ b/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php
@@ -109,5 +109,6 @@ public function testSettingsForm() {
namespace Drupal\Core\Form;
if (!function_exists('drupal_set_message')) {
- function drupal_set_message() {}
+ function drupal_set_message() {
+ }
}
diff --git a/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php b/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php
index c27f3d4f52..00c82dbd91 100644
--- a/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php
+++ b/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php
@@ -111,7 +111,7 @@ protected function getDisplayModeOptions() {
/**
* {@inheritdoc}
*/
- protected function getDisplayModesLink() {;
+ protected function getDisplayModesLink() {
return [
'#type' => 'link',
'#title' => t('Manage view modes'),
diff --git a/core/modules/language/src/Form/NegotiationConfigureForm.php b/core/modules/language/src/Form/NegotiationConfigureForm.php
index c1333e6a27..0adb5f6215 100644
--- a/core/modules/language/src/Form/NegotiationConfigureForm.php
+++ b/core/modules/language/src/Form/NegotiationConfigureForm.php
@@ -213,7 +213,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
* @param string $type
* The language type to generate the table for.
*/
- protected function configureFormTable(array &$form, $type) {
+ protected function configureFormTable(array &$form, $type) {
$info = $form['#language_types_info'][$type];
$table_form = [
diff --git a/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php b/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
index 9ed7abd1ef..7095bc18e2 100644
--- a/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
@@ -198,7 +198,7 @@ protected function checkConfigurableLanguageWeight($state = 'by default') {
* @return int
* Maximum weight of configurable languages.
*/
- protected function getHighestConfigurableLanguageWeight(){
+ protected function getHighestConfigurableLanguageWeight() {
$max_weight = 0;
$storage = $this->container->get('entity_type.manager')
diff --git a/core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php b/core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php
index face32e69b..ee496e248a 100644
--- a/core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php
@@ -21,7 +21,7 @@ class LocaleFileSystemFormTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
- protected function setUp(){
+ protected function setUp() {
parent::setUp();
$account = $this->drupalCreateUser(['administer site configuration']);
$this->drupalLogin($account);
diff --git a/core/modules/rest/src/Plugin/Type/ResourcePluginManager.php b/core/modules/rest/src/Plugin/Type/ResourcePluginManager.php
index 3ba73331e9..4dd9ca2d4e 100644
--- a/core/modules/rest/src/Plugin/Type/ResourcePluginManager.php
+++ b/core/modules/rest/src/Plugin/Type/ResourcePluginManager.php
@@ -43,7 +43,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac
*
* @see https://www.drupal.org/node/2874934
*/
- public function getInstance(array $options){
+ public function getInstance(array $options) {
if (isset($options['id'])) {
return $this->createInstance($options['id']);
}
diff --git a/core/modules/rest/tests/src/Functional/AnonResourceTestTrait.php b/core/modules/rest/tests/src/Functional/AnonResourceTestTrait.php
index b05ddf2a9c..284d17eec2 100644
--- a/core/modules/rest/tests/src/Functional/AnonResourceTestTrait.php
+++ b/core/modules/rest/tests/src/Functional/AnonResourceTestTrait.php
@@ -31,6 +31,7 @@ protected function assertResponseWhenMissingAuthentication(ResponseInterface $re
/**
* {@inheritdoc}
*/
- protected function assertAuthenticationEdgeCases($method, Url $url, array $request_options) {}
+ protected function assertAuthenticationEdgeCases($method, Url $url, array $request_options) {
+ }
}
diff --git a/core/modules/rest/tests/src/Functional/BasicAuthResourceTestTrait.php b/core/modules/rest/tests/src/Functional/BasicAuthResourceTestTrait.php
index 6f8c621727..fbb870bd89 100644
--- a/core/modules/rest/tests/src/Functional/BasicAuthResourceTestTrait.php
+++ b/core/modules/rest/tests/src/Functional/BasicAuthResourceTestTrait.php
@@ -38,6 +38,7 @@ protected function assertResponseWhenMissingAuthentication(ResponseInterface $re
/**
* {@inheritdoc}
*/
- protected function assertAuthenticationEdgeCases($method, Url $url, array $request_options) {}
+ protected function assertAuthenticationEdgeCases($method, Url $url, array $request_options) {
+ }
}
diff --git a/core/modules/serialization/serialization.install b/core/modules/serialization/serialization.install
index afc3311b4c..f5a11b8805 100644
--- a/core/modules/serialization/serialization.install
+++ b/core/modules/serialization/serialization.install
@@ -33,7 +33,8 @@ function serialization_requirements($phase) {
/**
* @see hal_update_8301()
*/
-function serialization_update_8301() {}
+function serialization_update_8301() {
+}
/**
* Add serialization.settings::bc_primitives_as_strings configuration.
diff --git a/core/modules/serialization/src/Encoder/XmlEncoder.php b/core/modules/serialization/src/Encoder/XmlEncoder.php
index 9db6ecde01..8e83e9d6d7 100644
--- a/core/modules/serialization/src/Encoder/XmlEncoder.php
+++ b/core/modules/serialization/src/Encoder/XmlEncoder.php
@@ -56,7 +56,7 @@ public function setBaseEncoder($encoder) {
/**
* {@inheritdoc}
*/
- public function encode($data, $format, array $context = []){
+ public function encode($data, $format, array $context = []) {
return $this->getBaseEncoder()->encode($data, $format, $context);
}
@@ -70,7 +70,7 @@ public function supportsEncoding($format) {
/**
* {@inheritdoc}
*/
- public function decode($data, $format, array $context = []){
+ public function decode($data, $format, array $context = []) {
return $this->getBaseEncoder()->decode($data, $format, $context);
}
diff --git a/core/modules/simpletest/src/RouteProvider.php b/core/modules/simpletest/src/RouteProvider.php
index 3aacc4068d..edb330bf22 100644
--- a/core/modules/simpletest/src/RouteProvider.php
+++ b/core/modules/simpletest/src/RouteProvider.php
@@ -49,7 +49,7 @@ public function getRouteByName($name) {
/**
* {@inheritdoc}
*/
- public function preLoadRoutes($names){
+ public function preLoadRoutes($names) {
return $this->lazyLoadItself()->preLoadRoutes($names);
}
diff --git a/core/modules/system/tests/src/Functional/File/ConfigTest.php b/core/modules/system/tests/src/Functional/File/ConfigTest.php
index da2003aa7d..883ef8ae0a 100644
--- a/core/modules/system/tests/src/Functional/File/ConfigTest.php
+++ b/core/modules/system/tests/src/Functional/File/ConfigTest.php
@@ -11,7 +11,7 @@
*/
class ConfigTest extends BrowserTestBase {
- protected function setUp(){
+ protected function setUp() {
parent::setUp();
$this->drupalLogin ($this->drupalCreateUser(['administer site configuration']));
}
diff --git a/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php b/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php
index fc8958c097..c0ee2d1727 100644
--- a/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php
+++ b/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php
@@ -21,7 +21,7 @@ protected function setUp() {
* Tests that a user can be assigned a role and that the role can be removed
* again.
*/
- public function testAssignAndRemoveRole() {
+ public function testAssignAndRemoveRole() {
$rid = $this->drupalCreateRole(['administer users']);
$account = $this->drupalCreateUser();
diff --git a/core/modules/views/src/EntityViewsData.php b/core/modules/views/src/EntityViewsData.php
index 49b0af80f8..89f130303d 100644
--- a/core/modules/views/src/EntityViewsData.php
+++ b/core/modules/views/src/EntityViewsData.php
@@ -307,7 +307,7 @@ public function getViewsData() {
// Add the entity type key to each table generated.
$entity_type_id = $this->entityType->id();
- array_walk($data, function(&$table_data) use ($entity_type_id){
+ array_walk($data, function(&$table_data) use ($entity_type_id) {
$table_data['table']['entity type'] = $entity_type_id;
});
diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
index a2e19a29d8..faa86b7acd 100644
--- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
@@ -1471,7 +1471,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#title' => $this->t('Show contextual links'),
'#default_value' => $this->getOption('show_admin_links'),
];
- break;
+ break;
case 'use_more':
$form['#title'] .= $this->t('Add a more link to the bottom of the display.');
$form['use_more'] = [
@@ -1866,7 +1866,7 @@ public function validateOptionsForm(&$form, FormStateInterface $form_state) {
if (preg_match('/[^a-zA-Z0-9-_ ]/', $css_class)) {
$form_state->setError($form['css_class'], $this->t('CSS classes must be alphanumeric or dashes only.'));
}
- break;
+ break;
case 'display_id':
if ($form_state->getValue('display_id')) {
if (preg_match('/[^a-z0-9_]/', $form_state->getValue('display_id'))) {
diff --git a/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php b/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php
index 1495399eeb..0e43bc516f 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php
@@ -69,11 +69,16 @@ protected function assertGrid(ViewExecutable $view, $alignment, $columns) {
}
$width = '0';
switch ($columns) {
- case 5: $width = '20'; break;
- case 4: $width = '25'; break;
- case 3: $width = '33.3333'; break;
- case 2: $width = '50'; break;
- case 1: $width = '100'; break;
+ case 5: $width = '20';
+ break;
+ case 4: $width = '25';
+ break;
+ case 3: $width = '33.3333';
+ break;
+ case 2: $width = '50';
+ break;
+ case 1: $width = '100';
+ break;
}
// Ensure last column exists.
$result = $this->xpath('//div[contains(@class, "views-col") and contains(@class, :columns) and starts-with(@style, :width)]', [':columns' => 'col-' . $columns, ':width' => 'width: ' . $width]);
diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist
index 037e82e350..ec4ddfa288 100644
--- a/core/phpcs.xml.dist
+++ b/core/phpcs.xml.dist
@@ -107,6 +107,7 @@
+
@@ -117,6 +118,11 @@
+
+
+
+
+
diff --git a/core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php b/core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php
index bdf66bdd30..ff401e112c 100644
--- a/core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php
@@ -21,7 +21,7 @@ class UrlRewritingTest extends FileTestBase {
/**
* Tests the rewriting of shipped file URLs by hook_file_url_alter().
*/
- public function testShippedFileURL() {
+ public function testShippedFileURL() {
// Test generating a URL to a shipped file (i.e. a file that is part of
// Drupal core, a module or a theme, for example a JavaScript file).
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php
index a3492ed223..4c6e22a8ea 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php
@@ -71,7 +71,7 @@ public function testDiscoveryInterface() {
* TRUE if the assertion succeeded, FALSE otherwise.
*/
protected function assertDefinitionIdentical(array $definition, array $expected_definition) {
- $func = function (&$item){
+ $func = function (&$item) {
if ($item instanceof TranslatableMarkup) {
$item = (string) $item;
}
diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
index aecc3e4364..434a0e8518 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
@@ -1496,7 +1496,7 @@ public function testonEntityTypeUpdateWithNewIndex() {
->willReturn(TRUE);
$this->dbSchemaHandler->expects($this->atLeastOnce())
->method('addIndex')
- ->with('entity_test', 'entity_test__b588603cb9', [['long_index_name', 10]], $this->callback(function($actual_value) use ($expected) {
+ ->with('entity_test', 'entity_test__b588603cb9', [['long_index_name', 10]], $this->callback(function($actual_value) use ($expected) {
$this->assertEquals($expected['entity_test']['indexes'], $actual_value['indexes']);
$this->assertEquals($expected['entity_test']['fields'], $actual_value['fields']);
// If the parameters don't match, the assertions above will throw an
diff --git a/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/hook_include.inc b/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/hook_include.inc
index da3a9c249f..ed4fb46471 100644
--- a/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/hook_include.inc
+++ b/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/hook_include.inc
@@ -8,4 +8,5 @@
/**
* Test hook.
*/
-function module_handler_test_hook_include() {}
+function module_handler_test_hook_include() {
+}
diff --git a/core/tests/Drupal/Tests/Core/Site/SettingsTest.php b/core/tests/Drupal/Tests/Core/Site/SettingsTest.php
index 4d34b30694..5e4f1d084c 100644
--- a/core/tests/Drupal/Tests/Core/Site/SettingsTest.php
+++ b/core/tests/Drupal/Tests/Core/Site/SettingsTest.php
@@ -28,7 +28,7 @@ class SettingsTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- protected function setUp(){
+ protected function setUp() {
$this->config = [
'one' => '1',
'two' => '2',
diff --git a/core/tests/Drupal/Tests/WebAssert.php b/core/tests/Drupal/Tests/WebAssert.php
index 9171a3f303..8149551700 100644
--- a/core/tests/Drupal/Tests/WebAssert.php
+++ b/core/tests/Drupal/Tests/WebAssert.php
@@ -451,7 +451,7 @@ public function assert($condition, $message) {
* @throws \Behat\Mink\Exception\ElementNotFoundException
* @throws \Behat\Mink\Exception\ExpectationException
*/
- public function fieldDisabled($field, TraversableElement $container = NULL) {
+ public function fieldDisabled($field, TraversableElement $container = NULL) {
$container = $container ?: $this->session->getPage();
$node = $container->findField($field);