From 33ba45820a7109193a8e43b618ef44a0bc1d0cc0 Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Thu, 24 Jun 2021 13:26:07 +0100
Subject: [PATCH] Issue #2719649 by Spokje, harsha012, jofitz, vprocessor,
 nikitagupta, cburschka, rasikap, hitesh-jain, quietone, longwave, mfernea,
 andypost, klausi, Malevi4, crazyrohila: Fix
 'Drupal.Commenting.InlineComment.SpacingBefore' coding standard

---
 .../Drupal/Component/Utility/UserAgent.php    |  2 ++
 .../lib/Drupal/Core/Config/ConfigImporter.php | 10 ++++---
 core/lib/Drupal/Core/DrupalKernel.php         |  2 +-
 .../Drupal/Core/Entity/ContentEntityBase.php  |  2 +-
 .../Drupal/Core/Entity/EntityFieldManager.php | 10 +++----
 core/lib/Drupal/Core/Entity/EntityForm.php    |  2 +-
 .../Drupal/Core/Entity/EntityViewBuilder.php  |  2 +-
 .../Routing/DefaultHtmlRouteProvider.php      |  2 +-
 .../ActiveLinkResponseFilter.php              |  2 +-
 .../MimeType/ExtensionMimeTypeGuesser.php     |  6 ++---
 core/lib/Drupal/Core/Form/FormState.php       |  4 +++
 core/lib/Drupal/Core/Form/FormSubmitter.php   |  2 +-
 core/lib/Drupal/Core/Render/RenderCache.php   | 14 ++++++++--
 core/lib/Drupal/Core/Render/Renderer.php      |  2 +-
 core/lib/Drupal/Core/Test/TestDiscovery.php   |  2 +-
 .../Core/Validation/DrupalTranslator.php      |  2 +-
 .../aggregator/processor/DefaultProcessor.php |  2 +-
 .../BookJavascriptTest.php                    |  2 +-
 .../src/Plugin/CKEditorPlugin/Internal.php    |  4 +--
 .../src/Kernel/CKEditorPluginManagerTest.php  | 10 +++----
 .../src/Functional/CommentThreadingTest.php   |  8 ++++--
 .../src/Functional/EditorSecurityTest.php     | 26 +++++++++----------
 .../src/Unit/EditorXssFilter/StandardTest.php |  4 +--
 .../migrate/source/d7/FieldInstance.php       |  8 +++---
 .../EntityReferenceAutoCreateTest.php         |  8 +++---
 .../filter/src/Entity/FilterFormat.php        |  4 +--
 .../Functional/LanguageConfigurationTest.php  |  2 +-
 .../BlockFormMessagesTest.php                 |  2 +-
 .../Plugin/Field/FieldWidget/LinkWidget.php   |  6 ++---
 .../media_library/media_library.module        |  4 +--
 .../src/MediaLibraryUiBuilder.php             |  2 +-
 .../tests/src/Kernel/MenuLinksTest.php        |  4 +--
 .../src/Plugin/migrate/source/SqlBase.php     |  2 +-
 core/modules/node/node.module                 |  4 +--
 .../Kernel/NodeAccessLanguageAwareTest.php    | 12 ++++-----
 .../tests/src/Kernel/SearchMatchTest.php      |  4 +--
 .../SerializedColumnNormalizerTrait.php       | 10 +++----
 .../modules/entity_test/entity_test.module    |  2 +-
 ...ityReferenceSelectionReferenceableTest.php |  8 +++---
 .../src/Kernel/Scripts/DbCommandBaseTest.php  |  2 ++
 .../views/filter/TaxonomyIndexTidDepth.php    |  2 +-
 core/modules/update/src/UpdateProcessor.php   |  2 +-
 .../src/Functional/UpdateContribTest.php      |  2 +-
 core/modules/user/src/AccountForm.php         |  6 ++---
 .../migrate/source/ProfileFieldTest.php       |  4 +--
 .../views/src/Form/ViewsExposedForm.php       |  2 +-
 .../Plugin/views/cache/CachePluginBase.php    |  2 +-
 .../views/src/Plugin/views/join/Subquery.php  |  2 +-
 .../views/src/Plugin/views/query/Sql.php      |  2 +-
 core/modules/views/src/ViewExecutable.php     |  2 +-
 .../tests/src/Functional/BulkFormTest.php     |  2 +-
 .../tests/src/Functional/Plugin/PagerTest.php |  4 +--
 core/modules/views/views.api.php              |  6 +++++
 core/phpcs.xml.dist                           |  3 +--
 .../Update/UpdatePathTestBase.php             |  2 +-
 .../Core/Database/SelectSubqueryTest.php      |  8 ++++++
 .../Drupal/KernelTests/KernelTestBase.php     |  2 +-
 .../Tests/Component/Graph/GraphTest.php       |  2 ++
 .../Tests/Component/Utility/XssTest.php       |  2 +-
 59 files changed, 152 insertions(+), 111 deletions(-)

diff --git a/core/lib/Drupal/Component/Utility/UserAgent.php b/core/lib/Drupal/Component/Utility/UserAgent.php
index c80c44e19deb..934049033c1a 100644
--- a/core/lib/Drupal/Component/Utility/UserAgent.php
+++ b/core/lib/Drupal/Component/Utility/UserAgent.php
@@ -40,9 +40,11 @@ public static function getBestMatchingLangcode($http_accept_language, $langcodes
     // The Accept-Language header contains information about the language
     // preferences configured in the user's user agent / operating system.
     // RFC 2616 (section 14.4) defines the Accept-Language header as follows:
+    // @code
     //   Accept-Language = "Accept-Language" ":"
     //                  1#( language-range [ ";" "q" "=" qvalue ] )
     //   language-range  = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )
+    // @endcode
     // Samples: "hu, en-us;q=0.66, en;q=0.33", "hu,en-us;q=0.5"
     $ua_langcodes = [];
     if (preg_match_all('@(?<=[, ]|^)([a-zA-Z-]+|\*)(?:;q=([0-9.]+))?(?:$|\s*,\s*)@', trim($http_accept_language), $matches, PREG_SET_ORDER)) {
diff --git a/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php
index 3340f6e654b9..4d998fa959c5 100644
--- a/core/lib/Drupal/Core/Config/ConfigImporter.php
+++ b/core/lib/Drupal/Core/Config/ConfigImporter.php
@@ -393,17 +393,19 @@ protected function createExtensionChangelist() {
     // dependencies are uninstalled last. Extensions of the same weight are
     // sorted in reverse alphabetical order, to ensure the order is exactly
     // opposite from installation. For example, this module list:
+    // @code
     // array(
     //   'actions' => 0,
     //   'ban' => 0,
     //   'options' => -2,
     //   'text' => -1,
     // );
+    // @endcode
     // will result in the following sort order:
-    // -2   options
-    // -1   text
-    //  0 0 ban
-    //  0 1 actions
+    // 1. -2   options
+    // 2. -1   text
+    // 3.  0 0 ban
+    // 4.  0 1 actions
     // @todo Move this sorting functionality to the extension system.
     array_multisort(array_values($module_list), SORT_ASC, array_keys($module_list), SORT_DESC, $module_list);
     $this->extensionChangelist['module']['uninstall'] = array_intersect(array_keys($module_list), $uninstall);
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 7e2cbe13a1f1..c8d76030624a 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -459,7 +459,7 @@ public function boot() {
     // Provide a default configuration, if not set.
     if (!isset($configuration['default'])) {
       // @todo Use extension_loaded('apcu') for non-testbot
-      //  https://www.drupal.org/node/2447753.
+      //   https://www.drupal.org/node/2447753.
       if (function_exists('apcu_fetch')) {
         $configuration['default']['cache_backend_class'] = '\Drupal\Component\FileCache\ApcuFileCacheBackend';
       }
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
index 35dca9a9c67b..3e82c6f95f5f 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
@@ -1434,7 +1434,7 @@ public function hasTranslationChanges() {
 
     foreach ($this->getFieldDefinitions() as $field_name => $definition) {
       // @todo Avoid special-casing the following fields. See
-      //    https://www.drupal.org/node/2329253.
+      //   https://www.drupal.org/node/2329253.
       if (in_array($field_name, $skip_fields, TRUE) || ($skip_untranslatable_fields && !$definition->isTranslatable())) {
         continue;
       }
diff --git a/core/lib/Drupal/Core/Entity/EntityFieldManager.php b/core/lib/Drupal/Core/Entity/EntityFieldManager.php
index 916a4dcac0d3..c8459426125d 100644
--- a/core/lib/Drupal/Core/Entity/EntityFieldManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityFieldManager.php
@@ -275,7 +275,7 @@ protected function buildBaseFieldDefinitions($entity_type_id) {
     $provider = $entity_type->getProvider();
     foreach ($base_field_definitions as $definition) {
       // @todo Remove this check once FieldDefinitionInterface exposes a proper
-      //  provider setter. See https://www.drupal.org/node/2225961.
+      //   provider setter. See https://www.drupal.org/node/2225961.
       if ($definition instanceof BaseFieldDefinition) {
         $definition->setProvider($provider);
       }
@@ -289,7 +289,7 @@ protected function buildBaseFieldDefinitions($entity_type_id) {
         // defining the field.
         foreach ($module_definitions as $field_name => $definition) {
           // @todo Remove this check once FieldDefinitionInterface exposes a
-          //  proper provider setter. See https://www.drupal.org/node/2225961.
+          //   proper provider setter. See https://www.drupal.org/node/2225961.
           if ($definition instanceof BaseFieldDefinition && $definition->getProvider() == NULL) {
             $definition->setProvider($module);
           }
@@ -397,7 +397,7 @@ protected function buildBundleFieldDefinitions($entity_type_id, $bundle, array $
     $provider = $entity_type->getProvider();
     foreach ($bundle_field_definitions as $definition) {
       // @todo Remove this check once FieldDefinitionInterface exposes a proper
-      //  provider setter. See https://www.drupal.org/node/2225961.
+      //   provider setter. See https://www.drupal.org/node/2225961.
       if ($definition instanceof BaseFieldDefinition) {
         $definition->setProvider($provider);
       }
@@ -411,7 +411,7 @@ protected function buildBundleFieldDefinitions($entity_type_id, $bundle, array $
         // defining the field.
         foreach ($module_definitions as $field_name => $definition) {
           // @todo Remove this check once FieldDefinitionInterface exposes a
-          //  proper provider setter. See https://www.drupal.org/node/2225961.
+          //   proper provider setter. See https://www.drupal.org/node/2225961.
           if ($definition instanceof BaseFieldDefinition) {
             $definition->setProvider($module);
           }
@@ -587,7 +587,7 @@ protected function buildFieldStorageDefinitions($entity_type_id) {
         // defining the field.
         foreach ($module_definitions as $field_name => $definition) {
           // @todo Remove this check once FieldDefinitionInterface exposes a
-          //  proper provider setter. See https://www.drupal.org/node/2225961.
+          //   proper provider setter. See https://www.drupal.org/node/2225961.
           if ($definition instanceof BaseFieldDefinition) {
             $definition->setProvider($module);
             $definition->setName($field_name);
diff --git a/core/lib/Drupal/Core/Entity/EntityForm.php b/core/lib/Drupal/Core/Entity/EntityForm.php
index 3056062df202..a29c392de904 100644
--- a/core/lib/Drupal/Core/Entity/EntityForm.php
+++ b/core/lib/Drupal/Core/Entity/EntityForm.php
@@ -324,7 +324,7 @@ protected function copyFormValuesToEntity(EntityInterface $entity, array $form,
       $values = array_diff_key($values, $this->entity->getPluginCollections());
     }
 
-    // @todo: This relies on a method that only exists for config and content
+    // @todo This relies on a method that only exists for config and content
     //   entities, in a different way. Consider moving this logic to a config
     //   entity specific implementation.
     foreach ($values as $key => $value) {
diff --git a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
index cc883b25cfd8..9ac0a6f55799 100644
--- a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
+++ b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
@@ -292,7 +292,7 @@ public function buildMultiple(array $build_list) {
         $this->alterBuild($build_list[$key], $entity, $display, $view_mode);
 
         // Assign the weights configured in the display.
-        // @todo: Once https://www.drupal.org/node/1875974 provides the missing
+        // @todo Once https://www.drupal.org/node/1875974 provides the missing
         //   API, only do it for 'extra fields', since other components have
         //   been taken care of in EntityViewDisplay::buildMultiple().
         foreach ($display->getComponents() as $name => $options) {
diff --git a/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php b/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php
index 1f7fd6d07e94..4dbd1d1bfecd 100644
--- a/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php
+++ b/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php
@@ -155,7 +155,7 @@ protected function getAddFormRoute(EntityTypeInterface $entity_type) {
       // If the entity has bundles, we can provide a bundle-specific title
       // and access requirements.
       $expected_parameter = $entity_type->getBundleEntityType() ?: $entity_type->getKey('bundle');
-      // @todo: We have to check if a route contains a bundle in its path as
+      // @todo We have to check if a route contains a bundle in its path as
       //   test entities have inconsistent usage of "add-form" link templates.
       //   Fix it in https://www.drupal.org/node/2699959.
       if (($bundle_key = $entity_type->getKey('bundle')) && strpos($route->getPath(), '{' . $expected_parameter . '}') !== FALSE) {
diff --git a/core/lib/Drupal/Core/EventSubscriber/ActiveLinkResponseFilter.php b/core/lib/Drupal/Core/EventSubscriber/ActiveLinkResponseFilter.php
index 1d7234eed6e2..4e530cf31bfe 100644
--- a/core/lib/Drupal/Core/EventSubscriber/ActiveLinkResponseFilter.php
+++ b/core/lib/Drupal/Core/EventSubscriber/ActiveLinkResponseFilter.php
@@ -180,7 +180,7 @@ public static function setLinkActiveClass($html_markup, $current_path, $is_front
       }
 
       // Get the HTML: this will be the opening part of a single tag, e.g.:
-      //   <a href="/" data-drupal-link-system-path="&lt;front&gt;">
+      // <a href="/" data-drupal-link-system-path="&lt;front&gt;">
       $tag = substr($html_markup, $pos_tag_start, $pos_tag_end - $pos_tag_start + 1);
 
       // Parse it into a DOMDocument so we can reliably read and modify
diff --git a/core/lib/Drupal/Core/File/MimeType/ExtensionMimeTypeGuesser.php b/core/lib/Drupal/Core/File/MimeType/ExtensionMimeTypeGuesser.php
index b0798000aac0..d8ec40554230 100644
--- a/core/lib/Drupal/Core/File/MimeType/ExtensionMimeTypeGuesser.php
+++ b/core/lib/Drupal/Core/File/MimeType/ExtensionMimeTypeGuesser.php
@@ -913,9 +913,9 @@ public function guessMimeType($path): ?string {
 
     // Iterate over the file parts, trying to find a match.
     // For my.awesome.image.jpeg, we try:
-    //   - jpeg
-    //   - image.jpeg, and
-    //   - awesome.image.jpeg
+    // - jpeg
+    // - image.jpeg, and
+    // - awesome.image.jpeg
     while ($additional_part = array_pop($file_parts)) {
       $extension = strtolower($additional_part . ($extension ? '.' . $extension : ''));
       if (isset($this->mapping['extensions'][$extension])) {
diff --git a/core/lib/Drupal/Core/Form/FormState.php b/core/lib/Drupal/Core/Form/FormState.php
index 8264371c832d..e52ac646773c 100644
--- a/core/lib/Drupal/Core/Form/FormState.php
+++ b/core/lib/Drupal/Core/Form/FormState.php
@@ -1206,8 +1206,11 @@ public function cleanValues() {
       // the value corresponding to this button.
       // We iterate over the #parents of this button and move a reference to
       // each parent in self::getValues(). For example, if #parents is:
+      // @code
       //   array('foo', 'bar', 'baz')
+      // @endcode
       // then the corresponding self::getValues() part will look like this:
+      // @code
       // array(
       //   'foo' => array(
       //     'bar' => array(
@@ -1215,6 +1218,7 @@ public function cleanValues() {
       //     ),
       //   ),
       // )
+      // @endcode
       // We start by (re)moving 'baz' to $last_parent, so we are able unset it
       // at the end of the iteration. Initially, $values will contain a
       // reference to self::getValues(), but in the iteration we move the
diff --git a/core/lib/Drupal/Core/Form/FormSubmitter.php b/core/lib/Drupal/Core/Form/FormSubmitter.php
index f3260e2fadc8..a3d116db0533 100644
--- a/core/lib/Drupal/Core/Form/FormSubmitter.php
+++ b/core/lib/Drupal/Core/Form/FormSubmitter.php
@@ -101,7 +101,7 @@ public function executeSubmitHandlers(&$form, FormStateInterface &$form_state) {
       // Check if a previous _submit handler has set a batch, but make sure we
       // do not react to a batch that is already being processed (for instance
       // if a batch operation performs a
-      //  \Drupal\Core\Form\FormBuilderInterface::submitForm()).
+      // \Drupal\Core\Form\FormBuilderInterface::submitForm()).
       if (($batch = &$this->batchGet()) && !isset($batch['id'])) {
         // Some previous submit handler has set a batch. To ensure correct
         // execution order, store the call in a special 'control' batch set.
diff --git a/core/lib/Drupal/Core/Render/RenderCache.php b/core/lib/Drupal/Core/Render/RenderCache.php
index 1a0233488947..385d317f4ae9 100644
--- a/core/lib/Drupal/Core/Render/RenderCache.php
+++ b/core/lib/Drupal/Core/Render/RenderCache.php
@@ -62,7 +62,7 @@ public function get(array $elements) {
     // Form submissions rely on the form being built during the POST request,
     // and render caching of forms prevents this from happening.
     // @todo remove the isMethodCacheable() check when
-    //       https://www.drupal.org/node/2367555 lands.
+    //   https://www.drupal.org/node/2367555 lands.
     if (!$this->requestStack->getCurrentRequest()->isMethodCacheable() || !$cid = $this->createCacheID($elements)) {
       return FALSE;
     }
@@ -89,7 +89,7 @@ public function set(array &$elements, array $pre_bubbling_elements) {
     // Form submissions rely on the form being built during the POST request,
     // and render caching of forms prevents this from happening.
     // @todo remove the isMethodCacheable() check when
-    //       https://www.drupal.org/node/2367555 lands.
+    //   https://www.drupal.org/node/2367555 lands.
     if (!$this->requestStack->getCurrentRequest()->isMethodCacheable() || !$cid = $this->createCacheID($elements)) {
       return FALSE;
     }
@@ -120,6 +120,7 @@ public function set(array &$elements, array $pre_bubbling_elements) {
       // were specified by all children, so what we need is a way to
       // persist that information between the cache write and the next cache
       // read. So, what we can do is store the following into 'foo':
+      // @code
       // [
       //   '#cache_redirect' => TRUE,
       //   '#cache' => [
@@ -127,6 +128,7 @@ public function set(array &$elements, array $pre_bubbling_elements) {
       //     'contexts' => ['b'],
       //   ],
       // ]
+      // @endcode
       //
       // This efficiently lets cacheGet() redirect to a $cid that includes all
       // of the required contexts. The strategy is on-demand: in the case where
@@ -152,6 +154,7 @@ public function set(array &$elements, array $pre_bubbling_elements) {
       // following:
       // - When a request is processed where context 'b' = 'b1', what would be
       //   cached for a $pre_bubbling_cid of 'foo' is:
+      // @code
       //   [
       //     '#cache_redirect' => TRUE,
       //     '#cache' => [
@@ -159,12 +162,14 @@ public function set(array &$elements, array $pre_bubbling_elements) {
       //       'contexts' => ['b', 'c'],
       //     ],
       //   ]
+      // @endcode
       // - When a request is processed where context 'b' = 'b2', we would
       //   retrieve the above from cache, but when following that redirection,
       //   get a cache miss, since we're processing a 'b' context value that
       //   has not yet been cached. Given the cache miss, we would continue
       //   with rendering the structure, perform the required context bubbling
       //   and then overwrite the above item with:
+      // @code
       //   [
       //     '#cache_redirect' => TRUE,
       //     '#cache' => [
@@ -172,11 +177,13 @@ public function set(array &$elements, array $pre_bubbling_elements) {
       //       'contexts' => ['b', 'd'],
       //     ],
       //   ]
+      // @endcode
       // - Now, if a request comes in where context 'b' = 'b1' again, the above
       //   would redirect to a cache key that doesn't exist, since we have not
       //   yet cached an item that includes 'b'='b1' and something for 'd'. So
       //   we would process this request as a cache miss, at the end of which,
       //   we would overwrite the above item back to:
+      // @code
       //   [
       //     '#cache_redirect' => TRUE,
       //     '#cache' => [
@@ -184,6 +191,7 @@ public function set(array &$elements, array $pre_bubbling_elements) {
       //       'contexts' => ['b', 'c'],
       //     ],
       //   ]
+      // @endcode
       // - The above would always result in accurate renderings, but would
       //   result in poor performance as we keep processing requests as cache
       //   misses even though the target of the redirection is cached, and
@@ -193,6 +201,7 @@ public function set(array &$elements, array $pre_bubbling_elements) {
       // A way to resolve the ping-pong problem is to eventually reach a cache
       // state where the redirection element includes all of the contexts used
       // throughout all requests:
+      // @code
       // [
       //   '#cache_redirect' => TRUE,
       //   '#cache' => [
@@ -200,6 +209,7 @@ public function set(array &$elements, array $pre_bubbling_elements) {
       //     'contexts' => ['b', 'c', 'd'],
       //   ],
       // ]
+      // @endcode
       //
       // We can't reach that state right away, since we don't know what the
       // result of future requests will be, but we can incrementally move
diff --git a/core/lib/Drupal/Core/Render/Renderer.php b/core/lib/Drupal/Core/Render/Renderer.php
index 6efede10ee7a..25b294c665e5 100644
--- a/core/lib/Drupal/Core/Render/Renderer.php
+++ b/core/lib/Drupal/Core/Render/Renderer.php
@@ -344,7 +344,7 @@ protected function doRender(&$elements, $is_root_call = FALSE) {
     // present (without such a callback, it would be impossible to replace the
     // placeholder), replace the current element with a placeholder.
     // @todo remove the isMethodCacheable() check when
-    //       https://www.drupal.org/node/2367555 lands.
+    //   https://www.drupal.org/node/2367555 lands.
     if (isset($elements['#create_placeholder']) && $elements['#create_placeholder'] === TRUE && $this->requestStack->getCurrentRequest()->isMethodCacheable()) {
       if (!isset($elements['#lazy_builder'])) {
         throw new \LogicException('When #create_placeholder is set, a #lazy_builder callback must be present as well.');
diff --git a/core/lib/Drupal/Core/Test/TestDiscovery.php b/core/lib/Drupal/Core/Test/TestDiscovery.php
index 879169f61a97..b9eeb0db23f0 100644
--- a/core/lib/Drupal/Core/Test/TestDiscovery.php
+++ b/core/lib/Drupal/Core/Test/TestDiscovery.php
@@ -186,7 +186,7 @@ public function getTestClasses($extension = NULL, array $types = []) {
       // unavailable modules. TestDiscovery should not filter out module
       // requirements for PHPUnit-based test classes.
       // @todo Move this behavior to \Drupal\simpletest\TestBase so tests can be
-      //       marked as skipped, instead.
+      //   marked as skipped, instead.
       // @see https://www.drupal.org/node/1273478
       if ($info['type'] == 'Simpletest') {
         if (!empty($info['requires']['module'])) {
diff --git a/core/lib/Drupal/Core/Validation/DrupalTranslator.php b/core/lib/Drupal/Core/Validation/DrupalTranslator.php
index 12b9594c4a6e..4025feda37fd 100644
--- a/core/lib/Drupal/Core/Validation/DrupalTranslator.php
+++ b/core/lib/Drupal/Core/Validation/DrupalTranslator.php
@@ -43,7 +43,7 @@ public function transChoice($id, $number, array $parameters = [], $domain = NULL
     }
 
     // Normally, calls to formatPlural() need to use literal strings, like
-    //   formatPlural($count, '1 item', '@count items')
+    // formatPlural($count, '1 item', '@count items')
     // so that the Drupal project POTX string extractor will correctly
     // extract the strings for translation and save them in a format that
     // formatPlural() can work with. However, this is a special case, because
diff --git a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
index 9d19abf1d3ca..fb229ac80140 100644
--- a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
+++ b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
@@ -187,7 +187,7 @@ public function process(FeedInterface $feed) {
       return;
     }
     foreach ($feed->items as $item) {
-      // @todo: The default entity view builder always returns an empty
+      // @todo The default entity view builder always returns an empty
       //   array, which is ignored in aggregator_save_item() currently. Should
       //   probably be fixed.
       if (empty($item['title'])) {
diff --git a/core/modules/book/tests/src/FunctionalJavascript/BookJavascriptTest.php b/core/modules/book/tests/src/FunctionalJavascript/BookJavascriptTest.php
index 1c8616dcf14b..cb4ac799b426 100644
--- a/core/modules/book/tests/src/FunctionalJavascript/BookJavascriptTest.php
+++ b/core/modules/book/tests/src/FunctionalJavascript/BookJavascriptTest.php
@@ -70,7 +70,7 @@ public function testBookOrdering() {
     $this->assertSession()->pageTextNotContains('You have unsaved changes.');
 
     // Drag and drop the '1st page' row over the '2nd page' row.
-    // @todo: Test also the reverse, '2nd page' over '1st page', when
+    // @todo Test also the reverse, '2nd page' over '1st page', when
     //   https://www.drupal.org/node/2769825 is fixed.
     // @see https://www.drupal.org/node/2769825
     $dragged = $this->xpath("//tr[@data-drupal-selector='edit-table-book-admin-{$page1->id()}']//a[@class='tabledrag-handle']")[0];
diff --git a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php
index cd33f5151491..8b4dbe098013 100644
--- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php
+++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php
@@ -475,8 +475,8 @@ protected function generateACFSettings(Editor $editor) {
           // attributes is allowed. However, that may not be the case: the "*"
           // tag may still apply restrictions.
           // Since CKEditor's ACF follows the following principle:
-          //     Once validated, an element or its property cannot be
-          //     invalidated by another rule.
+          // - Once validated, an element or its property cannot be
+          //   invalidated by another rule.
           // That means that the most permissive setting wins. Which means that
           // it will still be allowed by CKEditor, for instance, to define any
           // style, no matter what the "*" tag's restrictions may be. If there
diff --git a/core/modules/ckeditor/tests/src/Kernel/CKEditorPluginManagerTest.php b/core/modules/ckeditor/tests/src/Kernel/CKEditorPluginManagerTest.php
index e8d49c46f0a0..32f1c77c8f32 100644
--- a/core/modules/ckeditor/tests/src/Kernel/CKEditorPluginManagerTest.php
+++ b/core/modules/ckeditor/tests/src/Kernel/CKEditorPluginManagerTest.php
@@ -86,13 +86,13 @@ public function testEnabledPlugins() {
     $this->assertSame(['internal' => NULL] + $enabled_plugins, $this->manager->getEnabledPluginFiles($editor, TRUE), 'Only the "internal" plugin is enabled.');
 
     // Case 3: enable each of the newly available plugins, if possible:
-    // a. Llama: cannot be enabled, since it does not implement
+    // 1. Llama: cannot be enabled, since it does not implement
     //    CKEditorPluginContextualInterface nor CKEditorPluginButtonsInterface.
-    // b. LlamaContextual: enabled by adding the 'Strike' button, which is
+    // 2. LlamaContextual: enabled by adding the 'Strike' button, which is
     //    part of another plugin!
-    // c. LlamaButton: automatically enabled by adding its 'Llama' button.
-    // d. LlamaContextualAndButton: enabled by either b or c.
-    // e. LlamaCSS: automatically enabled by add its 'LlamaCSS' button.
+    // 3. LlamaButton: automatically enabled by adding its 'Llama' button.
+    // 4. LlamaContextualAndButton: enabled by either 2 or 3.
+    // 5. LlamaCSS: automatically enabled by add its 'LlamaCSS' button.
     // Below, we will first enable the "Llama" button, which will cause the
     // LlamaButton and LlamaContextualAndButton plugins to be enabled. Then we
     // will remove the "Llama" button and add the "Strike" button, which will
diff --git a/core/modules/comment/tests/src/Functional/CommentThreadingTest.php b/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
index aaab0e617f8e..00ccd29c2498 100644
--- a/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
@@ -134,12 +134,14 @@ public function testCommentThreading() {
    */
   protected function assertParentLink($cid, $pid) {
     // This pattern matches a markup structure like:
+    // @code
     // <a id="comment-2"></a>
     // <article>
     //   <p class="parent">
     //     <a href="...comment-1"></a>
     //   </p>
-    //  </article>
+    // </article>
+    // @endcode
     $pattern = "//article[@id='comment-$cid']//p[contains(@class, 'parent')]//a[contains(@href, 'comment-$pid')]";
 
     $this->assertSession()->elementExists('xpath', $pattern);
@@ -153,10 +155,12 @@ protected function assertParentLink($cid, $pid) {
    */
   protected function assertNoParentLink($cid) {
     // This pattern matches a markup structure like:
+    // @code
     // <a id="comment-2"></a>
     // <article>
     //   <p class="parent"></p>
-    //  </article>
+    // </article>
+    // @endcode
 
     $pattern = "//article[@id='comment-$cid']//p[contains(@class, 'parent')]";
     $this->assertSession()->elementNotExists('xpath', $pattern);
diff --git a/core/modules/editor/tests/src/Functional/EditorSecurityTest.php b/core/modules/editor/tests/src/Functional/EditorSecurityTest.php
index 1cb2724e4ffa..4574ccb5ae3f 100644
--- a/core/modules/editor/tests/src/Functional/EditorSecurityTest.php
+++ b/core/modules/editor/tests/src/Functional/EditorSecurityTest.php
@@ -80,11 +80,11 @@ protected function setUp(): void {
     parent::setUp();
 
     // Create 5 text formats, to cover all potential use cases:
-    //  1. restricted_without_editor (untrusted: anonymous)
-    //  2. restricted_with_editor (normal: authenticated)
-    //  3. restricted_plus_dangerous_tag_with_editor (privileged: trusted)
-    //  4. unrestricted_without_editor (privileged: admin)
-    //  5. unrestricted_with_editor (privileged: admin)
+    // 1. restricted_without_editor (untrusted: anonymous)
+    // 2. restricted_with_editor (normal: authenticated)
+    // 3. restricted_plus_dangerous_tag_with_editor (privileged: trusted)
+    // 4. unrestricted_without_editor (privileged: admin)
+    // 5. unrestricted_with_editor (privileged: admin)
     // With text formats 2, 3 and 5, we also associate a text editor that does
     // not guarantee XSS safety. "restricted" means the text format has XSS
     // filters on output, "unrestricted" means the opposite.
@@ -170,12 +170,12 @@ protected function setUp(): void {
     ]);
 
     // Create 4 users, each with access to different text formats/editors:
-    //   - "untrusted": restricted_without_editor
-    //   - "normal": restricted_with_editor,
-    //   - "trusted": restricted_plus_dangerous_tag_with_editor
-    //   - "privileged": restricted_without_editor, restricted_with_editor,
-    //     restricted_plus_dangerous_tag_with_editor,
-    //     unrestricted_without_editor and unrestricted_with_editor
+    // - "untrusted": restricted_without_editor
+    // - "normal": restricted_with_editor,
+    // - "trusted": restricted_plus_dangerous_tag_with_editor
+    // - "privileged": restricted_without_editor, restricted_with_editor,
+    //   restricted_plus_dangerous_tag_with_editor,
+    //   unrestricted_without_editor and unrestricted_with_editor
     $this->untrustedUser = $this->drupalCreateUser([
       'create article content',
       'edit any article content',
@@ -387,8 +387,8 @@ public function testSwitchingSecurity() {
     ];
 
     // Log in as the privileged user, and for every sample, do the following:
-    //  - switch to every other text format/editor
-    //  - assert the XSS-filtered values that we get from the server
+    // - switch to every other text format/editor
+    // - assert the XSS-filtered values that we get from the server
     $this->drupalLogin($this->privilegedUser);
     $cookies = $this->getSessionCookies();
 
diff --git a/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php b/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php
index 59ea5446fb75..b570982ab5f3 100644
--- a/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php
+++ b/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php
@@ -144,7 +144,7 @@ public function providerTestFilterXss() {
 
     // Spaces and meta chars before the JavaScript in images for XSS.
     // @see https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Spaces_and_meta_chars_before_the_JavaScript_in_images_for_XSS
-    // @fixme This dataset currently fails under 5.4 because of
+    // @todo This dataset currently fails under 5.4 because of
     //   https://www.drupal.org/node/1210798. Restore after it's fixed.
     if (version_compare(PHP_VERSION, '5.4.0', '<')) {
       $data[] = ['<IMG SRC=" &#14;  javascript:alert(\'XSS\');">', '<IMG src="alert(&#039;XSS&#039;);">'];
@@ -175,7 +175,7 @@ public function providerTestFilterXss() {
     // Double open angle brackets.
     // @see https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Double_open_angle_brackets
     // @see http://ha.ckers.org/blog/20060611/hotbot-xss-vulnerability/ to
-    //      understand why this is a vulnerability.
+    // understand why this is a vulnerability.
     $data[] = ['<iframe src=http://ha.ckers.org/scriptlet.html <', '<iframe src="http://ha.ckers.org/scriptlet.html">'];
 
     // Escaping JavaScript escapes.
diff --git a/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php b/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php
index be28a8fd46dc..d23c1b52c4fc 100644
--- a/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php
+++ b/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php
@@ -148,10 +148,10 @@ public function prepareRow(Row $row) {
     if ($row->getSourceProperty('entity_type') == 'node') {
       $language_content_type_bundle = (int) $this->variableGet('language_content_type_' . $row->getSourceProperty('bundle'), 0);
       // language_content_type_[bundle] may be
-      //   - 0: no language support
-      //   - 1: language assignment support
-      //   - 2: node translation support
-      //   - 4: entity translation support
+      // - 0: no language support
+      // - 1: language assignment support
+      // - 2: node translation support
+      // - 4: entity translation support
       if ($language_content_type_bundle === 2 || ($language_content_type_bundle === 4 && $row->getSourceProperty('translatable'))) {
         $translatable = TRUE;
       }
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
index 21392ab2b882..83a6f0578749 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
@@ -229,17 +229,19 @@ public function testMultipleTargetBundles() {
     //   a way to catch and assert user-triggered errors.
 
     // Test the case when the field config settings are inconsistent.
+    // @code
     // unset($handler_settings['auto_create_bundle']);
     // $field_config->setSetting('handler_settings', $handler_settings);
     // $field_config->save();
     //
     // $this->drupalGet('node/add/' . $this->referencingType);
     // $error_message = sprintf(
-    //  "Create referenced entities if they don't already exist option is enabled but a specific destination bundle is not set. You should re-visit and fix the settings of the '%s' (%s) field.",
-    //  $field_config->getLabel(),
-    //  $field_config->getName()
+    //   "Create referenced entities if they don't already exist option is enabled but a specific destination bundle is not set. You should re-visit and fix the settings of the '%s' (%s) field.",
+    //   $field_config->getLabel(),
+    //   $field_config->getName()
     // );
     // $this->assertErrorLogged($error_message);
+    // @endcode
   }
 
   /**
diff --git a/core/modules/filter/src/Entity/FilterFormat.php b/core/modules/filter/src/Entity/FilterFormat.php
index abd9b6aae8a5..8b846be57a33 100644
--- a/core/modules/filter/src/Entity/FilterFormat.php
+++ b/core/modules/filter/src/Entity/FilterFormat.php
@@ -357,8 +357,8 @@ public function getHtmlRestrictions() {
                 }
                 // Both list an array of attribute values; do an intersection,
                 // where we take into account that a value of:
-                //  - TRUE means the attribute value is allowed;
-                //  - FALSE means the attribute value is forbidden;
+                // - TRUE means the attribute value is allowed;
+                // - FALSE means the attribute value is forbidden;
                 // hence we keep the ANDed result.
                 else {
                   $intersection[$tag] = array_intersect_key($intersection[$tag], $new_attributes);
diff --git a/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php b/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
index 9f764f477d07..2e0292da0ac5 100644
--- a/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
@@ -113,7 +113,7 @@ public function testLanguageConfiguration() {
     $this->submitForm($edit, 'Save configuration');
     $this->assertSession()->pageTextContains('The prefix may only be left blank for the selected detection fallback language.');
 
-    //  Check that prefix cannot be changed to contain a slash.
+    // Check that prefix cannot be changed to contain a slash.
     $edit = [
       'prefix[en]' => 'foo/bar',
     ];
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php
index bf1f96ca7e2a..4fccd1c8427e 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php
@@ -44,7 +44,7 @@ protected function setUp(): void {
    */
   public function testValidationMessage() {
     // @todo Work out why this fixes random fails in this test.
-    //    https://www.drupal.org/project/drupal/issues/3055982
+    //   https://www.drupal.org/project/drupal/issues/3055982
     $this->getSession()->resizeWindow(800, 1000);
     $assert_session = $this->assertSession();
     $page = $this->getSession()->getPage();
diff --git a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
index b4dbdd8c36cf..6faa9393f044 100644
--- a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
+++ b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
@@ -74,7 +74,7 @@ protected static function getUriAsDisplayableString($uri) {
       list($entity_type, $entity_id) = explode('/', substr($uri, 7), 2);
       // Show the 'entity:' URI as the entity autocomplete would.
       // @todo Support entity types other than 'node'. Will be fixed in
-      //    https://www.drupal.org/node/2423093.
+      //   https://www.drupal.org/node/2423093.
       if ($entity_type == 'node' && $entity = \Drupal::entityTypeManager()->getStorage($entity_type)->load($entity_id)) {
         $displayable_string = EntityAutocomplete::getEntityLabels([$entity]);
       }
@@ -111,7 +111,7 @@ protected static function getUserEnteredStringAsUri($string) {
     $entity_id = EntityAutocomplete::extractEntityIdFromAutocompleteInput($string);
     if ($entity_id !== NULL) {
       // @todo Support entity types other than 'node'. Will be fixed in
-      //    https://www.drupal.org/node/2423093.
+      //   https://www.drupal.org/node/2423093.
       $uri = 'entity:node/' . $entity_id;
     }
     // Support linking to nothing.
@@ -202,7 +202,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
     if ($this->supportsInternalLinks()) {
       $element['uri']['#type'] = 'entity_autocomplete';
       // @todo The user should be able to select an entity type. Will be fixed
-      //    in https://www.drupal.org/node/2423093.
+      //   in https://www.drupal.org/node/2423093.
       $element['uri']['#target_type'] = 'node';
       // Disable autocompletion when the first character is '/', '#' or '?'.
       $element['uri']['#attributes']['data-autocomplete-first-character-blacklist'] = '/#?';
diff --git a/core/modules/media_library/media_library.module b/core/modules/media_library/media_library.module
index 5726a80a4a62..1b6beb870786 100644
--- a/core/modules/media_library/media_library.module
+++ b/core/modules/media_library/media_library.module
@@ -375,7 +375,7 @@ function media_library_local_tasks_alter(&$local_tasks) {
  */
 function media_library_image_style_access(EntityInterface $entity, $operation, AccountInterface $account) {
   // Prevent the fallback 'media_library' image style from being deleted.
-  // @todo: Lock the image style instead of preventing delete access.
+  // @todo Lock the image style instead of preventing delete access.
   //   https://www.drupal.org/project/drupal/issues/2247293
   if ($operation === 'delete' && $entity->id() === 'media_library') {
     return AccessResult::forbidden();
@@ -459,7 +459,7 @@ function _media_library_configure_view_display(MediaTypeInterface $type) {
     $display->removeComponent($name);
   }
 
-  // @todo: Remove dependency on 'medium' and 'thumbnail' image styles from
+  // @todo Remove dependency on 'medium' and 'thumbnail' image styles from
   //   media and media library modules.
   //   https://www.drupal.org/project/drupal/issues/3030437
   $image_style = ImageStyle::load('medium');
diff --git a/core/modules/media_library/src/MediaLibraryUiBuilder.php b/core/modules/media_library/src/MediaLibraryUiBuilder.php
index 12f8e08a5ce8..b00bd7af9415 100644
--- a/core/modules/media_library/src/MediaLibraryUiBuilder.php
+++ b/core/modules/media_library/src/MediaLibraryUiBuilder.php
@@ -225,7 +225,7 @@ protected function buildMediaTypeMenu(MediaLibraryState $state) {
       return [];
     }
 
-    // @todo: Add a class to the li element.
+    // @todo Add a class to the li element.
     //   https://www.drupal.org/project/drupal/issues/3029227
     $menu = [
       '#theme' => 'links__media_library_menu',
diff --git a/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php b/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php
index a5e2b16f243f..afe0aee563e3 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php
@@ -67,8 +67,8 @@ public function createLinkHierarchy($module = 'menu_test') {
     // Then create a simple link hierarchy:
     // - parent
     //   - child-1
-    //      - child-1-1
-    //      - child-1-2
+    //     - child-1-1
+    //     - child-1-2
     //   - child-2
     $base_options = [
       'title' => 'Menu link test',
diff --git a/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
index 954f8f16b74b..078881701505 100644
--- a/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
+++ b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
@@ -276,7 +276,7 @@ protected function initializeIterator() {
       //    conditions, so we need to OR them together (but AND with any existing
       //    conditions in the query). So, ultimately the SQL condition will look
       //    like (original conditions) AND (map IS NULL OR map needs update
-      //      OR above high water).
+      //    OR above high water).
       $conditions = $this->query->orConditionGroup();
       $condition_added = FALSE;
       $added_fields = [];
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 616d8b4de605..9099b4e12e01 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -506,8 +506,8 @@ function template_preprocess_node(&$variables) {
   $variables['url'] = !$node->isNew() ? $node->toUrl('canonical')->toString() : NULL;
 
   // The 'page' variable is set to TRUE in two occasions:
-  //   - The view mode is 'full' and we are on the 'node.view' route.
-  //   - The node is in preview and view mode is either 'full' or 'default'.
+  // - The view mode is 'full' and we are on the 'node.view' route.
+  // - The node is in preview and view mode is either 'full' or 'default'.
   $variables['page'] = ($variables['view_mode'] == 'full' && (node_is_page($node)) || (isset($node->in_preview) && in_array($node->preview_view_mode, ['full', 'default'])));
 
   // Helpful $content variable for templates.
diff --git a/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php b/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php
index deaf02d68768..7fb406758629 100644
--- a/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php
@@ -89,13 +89,13 @@ protected function setUp(): void {
 
     // Create six nodes:
     // 1. Four Hungarian nodes with Catalan translations
-    //   - One with neither language marked as private.
-    //   - One with only the Hungarian translation private.
-    //   - One with only the Catalan translation private.
-    //   - One with both the Hungarian and Catalan translations private.
+    //    - One with neither language marked as private.
+    //    - One with only the Hungarian translation private.
+    //    - One with only the Catalan translation private.
+    //    - One with both the Hungarian and Catalan translations private.
     // 2. Two nodes with no language specified.
-    //   - One public.
-    //   - One private.
+    //    - One public.
+    //    - One private.
     $this->nodes['both_public'] = $node = $this->drupalCreateNode([
       'body' => [[]],
       'langcode' => 'hu',
diff --git a/core/modules/search/tests/src/Kernel/SearchMatchTest.php b/core/modules/search/tests/src/Kernel/SearchMatchTest.php
index 511c0ef6782e..9ec5853f7200 100644
--- a/core/modules/search/tests/src/Kernel/SearchMatchTest.php
+++ b/core/modules/search/tests/src/Kernel/SearchMatchTest.php
@@ -108,9 +108,9 @@ public function _testQueries() {
     // Note: OR queries that include short words in OR groups are only accepted
     // if the ORed terms are ANDed with at least one long word in the rest of
     // the query. Examples:
-    //   enim dolore OR ut = enim (dolore OR ut) = (enim dolor) OR (enim ut)
+    // -  enim dolore OR ut = enim (dolore OR ut) = (enim dolor) OR (enim ut)
     // is good, and
-    //   dolore OR ut = (dolore) OR (ut)
+    // -  dolore OR ut = (dolore) OR (ut)
     // is bad. This is a design limitation to avoid full table scans.
     $queries = [
       // Simple AND queries.
diff --git a/core/modules/serialization/src/Normalizer/SerializedColumnNormalizerTrait.php b/core/modules/serialization/src/Normalizer/SerializedColumnNormalizerTrait.php
index bf6eb0643cd5..0b740dd3e5e8 100644
--- a/core/modules/serialization/src/Normalizer/SerializedColumnNormalizerTrait.php
+++ b/core/modules/serialization/src/Normalizer/SerializedColumnNormalizerTrait.php
@@ -23,11 +23,11 @@ trait SerializedColumnNormalizerTrait {
   protected function checkForSerializedStrings($data, $class, FieldItemInterface $field_item) {
     // Require specialized denormalizers for fields with 'serialize' columns.
     // Note: this cannot be checked in ::supportsDenormalization() because at
-    //       that time we only have the field item class. ::hasSerializeColumn()
-    //       must be able to call $field_item->schema(), which requires a field
-    //       storage definition. To determine that, the entity type and bundle
-    //       must be known, which is contextual information that the Symfony
-    //       serializer does not pass to ::supportsDenormalization().
+    // that time we only have the field item class. ::hasSerializeColumn()
+    // must be able to call $field_item->schema(), which requires a field
+    // storage definition. To determine that, the entity type and bundle
+    // must be known, which is contextual information that the Symfony
+    // serializer does not pass to ::supportsDenormalization().
     if (!is_array($data)) {
       $data = [$field_item->getDataDefinition()->getMainPropertyName() => $data];
     }
diff --git a/core/modules/system/tests/modules/entity_test/entity_test.module b/core/modules/system/tests/modules/entity_test/entity_test.module
index af58b40f1386..1b77226d17e0 100644
--- a/core/modules/system/tests/modules/entity_test/entity_test.module
+++ b/core/modules/system/tests/modules/entity_test/entity_test.module
@@ -175,7 +175,7 @@ function entity_test_entity_base_field_info_alter(&$fields, EntityTypeInterface
   // In 8001 we are assuming that a new definition with multiple cardinality has
   // been deployed.
   // @todo Remove this if we end up using state definitions at runtime. See
-  //    https://www.drupal.org/node/2554235.
+  //   https://www.drupal.org/node/2554235.
   if ($entity_type->id() == 'entity_test' && $state->get('entity_test.db_updates.entity_definition_updates') == 8001) {
     $fields['user_id']->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
   }
diff --git a/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php b/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php
index ba2d96292591..bab37c3981dd 100644
--- a/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php
+++ b/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php
@@ -185,15 +185,15 @@ public function providerTestCases() {
       // 'xyabz_', 'foo_', 'bar_', 'baz_', 'șz_', NULL, '<strong>').
       //
       // Note: Even we set the name as NULL, when retrieving the label from the
-      //   entity we'll get an empty string, meaning that this match operator
-      //   will return TRUE every time.
+      // entity we'll get an empty string, meaning that this match operator
+      // will return TRUE every time.
       [NULL, 'IS NOT NULL', 0, 9, static::$labels, 9],
       // Referenceables null, no limit. Expecting 9 items ('abc', 'Xyz_',
       // 'xyabz_', 'foo_', 'bar_', 'baz_', 'șz_', NULL, '<strong>').
       //
       // Note: Even we set the name as NULL, when retrieving the label from the
-      //   entity we'll get an empty string, meaning that this match operator
-      //   will return FALSE every time.
+      // entity we'll get an empty string, meaning that this match operator
+      // will return FALSE every time.
       [NULL, 'IS NULL', 0, 9, static::$labels, 9],
       // Referenceables containing '<strong>' markup, no limit. Expecting 1 item
       // ('<strong>').
diff --git a/core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php b/core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php
index 3c6d8aa34eb1..cef2414ec001 100644
--- a/core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php
+++ b/core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php
@@ -96,10 +96,12 @@ public function testPrefix() {
     $this->assertEquals('extra2', $command->getDatabaseConnection($command_tester->getInput())->tablePrefix());
 
     // This breaks simpletest cleanup.
+    // @code
     //    $command_tester->execute([
     //      '--prefix' => 'notsimpletest',
     //    ]);
     //    $this->assertEquals('notsimpletest', $command->getDatabaseConnection($command_tester->getInput())->tablePrefix());
+    // @endcode
   }
 
 }
diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php
index 6b710d62346d..e3372ae1910f 100644
--- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php
+++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php
@@ -60,7 +60,7 @@ public function query() {
 
     // The normal use of ensureMyTable() here breaks Views.
     // So instead we trick the filter into using the alias of the base table.
-    //   See https://www.drupal.org/node/271833.
+    // See https://www.drupal.org/node/271833.
     // If a relationship is set, we must use the alias it provides.
     if (!empty($this->relationship)) {
       $this->tableAlias = $this->relationship;
diff --git a/core/modules/update/src/UpdateProcessor.php b/core/modules/update/src/UpdateProcessor.php
index 1e2cfb7432fb..932a0b5d0985 100644
--- a/core/modules/update/src/UpdateProcessor.php
+++ b/core/modules/update/src/UpdateProcessor.php
@@ -166,7 +166,7 @@ public function processFetchTask($project) {
     }
     if (!empty($data)) {
       $available = $this->parseXml($data);
-      // @todo: Purge release data we don't need. See
+      // @todo Purge release data we don't need. See
       //   https://www.drupal.org/node/238950.
       if (!empty($available)) {
         // Only if we fetched and parsed something sane do we return success.
diff --git a/core/modules/update/tests/src/Functional/UpdateContribTest.php b/core/modules/update/tests/src/Functional/UpdateContribTest.php
index 5265eafbe796..a24b70957adc 100644
--- a/core/modules/update/tests/src/Functional/UpdateContribTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateContribTest.php
@@ -211,7 +211,7 @@ public function testUpdateContribOrder() {
    */
   public function testUpdateBaseThemeSecurityUpdate() {
     // @todo https://www.drupal.org/node/2338175 base themes have to be
-    //  installed.
+    //   installed.
     // Only install the subtheme, not the base theme.
     \Drupal::service('theme_installer')->install(['update_test_subtheme']);
 
diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php
index 0a78611f2449..2358d9b654de 100644
--- a/core/modules/user/src/AccountForm.php
+++ b/core/modules/user/src/AccountForm.php
@@ -75,9 +75,9 @@ public function form(array $form, FormStateInterface $form_state) {
 
     // For a new account, there are 2 sub-cases:
     // $self_register: A user creates their own, new, account
-    //   (path '/user/register')
+    // (path '/user/register')
     // $admin_create: An administrator creates a new account for another user
-    //   (path '/admin/people/create')
+    // (path '/admin/people/create')
     // If the current user is logged in and has permission to create users
     // then it must be the second case.
     $admin_create = $register && $account->access('create');
@@ -352,7 +352,7 @@ public function syncUserLangcode($entity_type_id, UserInterface $user, array &$f
    */
   public function buildEntity(array $form, FormStateInterface $form_state) {
     // Change the roles array to a list of enabled roles.
-    // @todo: Alter the form state as the form values are directly extracted and
+    // @todo Alter the form state as the form values are directly extracted and
     //   set on the field, which throws an exception as the list requires
     //   numeric keys. Allow to override this per field. As this function is
     //   called twice, we have to prevent it from getting the array keys twice.
diff --git a/core/modules/user/tests/src/Kernel/Plugin/migrate/source/ProfileFieldTest.php b/core/modules/user/tests/src/Kernel/Plugin/migrate/source/ProfileFieldTest.php
index c24a0a79e267..1f29505a5a8e 100644
--- a/core/modules/user/tests/src/Kernel/Plugin/migrate/source/ProfileFieldTest.php
+++ b/core/modules/user/tests/src/Kernel/Plugin/migrate/source/ProfileFieldTest.php
@@ -103,8 +103,8 @@ public function providerSource() {
     ];
 
     // Expected options are:
-    //  for "checkbox" fields - array with NULL options
-    //  for "selection" fields - options in both keys and values
+    // - for "checkbox" fields - array with NULL options.
+    // - for "selection" fields - options in both keys and values.
     $expected_field_options = [
       '',
       '',
diff --git a/core/modules/views/src/Form/ViewsExposedForm.php b/core/modules/views/src/Form/ViewsExposedForm.php
index 87d4559413a8..bbeb4db2766e 100644
--- a/core/modules/views/src/Form/ViewsExposedForm.php
+++ b/core/modules/views/src/Form/ViewsExposedForm.php
@@ -208,7 +208,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
       if (!empty($key) && !in_array($key, $exclude)) {
         if (is_array($value)) {
           // Handle checkboxes, we only want to include the checked options.
-          // @todo: revisit the need for this when
+          // @todo revisit the need for this when
           //   https://www.drupal.org/node/342316 is resolved.
           $checked = Checkboxes::getCheckedCheckboxes($value);
           foreach ($checked as $option_id) {
diff --git a/core/modules/views/src/Plugin/views/cache/CachePluginBase.php b/core/modules/views/src/Plugin/views/cache/CachePluginBase.php
index fd9278876aa0..66df4a6e465a 100644
--- a/core/modules/views/src/Plugin/views/cache/CachePluginBase.php
+++ b/core/modules/views/src/Plugin/views/cache/CachePluginBase.php
@@ -214,7 +214,7 @@ public function generateResultsKey() {
         'build_info' => $build_info,
       ];
       // @todo https://www.drupal.org/node/2433591 might solve it to not require
-      //    the pager information here.
+      //   the pager information here.
       $key_data['pager'] = [
         'page' => $this->view->getCurrentPage(),
         'items_per_page' => $this->view->getItemsPerPage(),
diff --git a/core/modules/views/src/Plugin/views/join/Subquery.php b/core/modules/views/src/Plugin/views/join/Subquery.php
index f407ffce33d2..8ef5342d108d 100644
--- a/core/modules/views/src/Plugin/views/join/Subquery.php
+++ b/core/modules/views/src/Plugin/views/join/Subquery.php
@@ -52,7 +52,7 @@ public function buildJoin($select_query, $table, $view_query) {
 
     // Tack on the extra.
     // This is just copied verbatim from the parent class, which itself has a
-    //   bug: https://www.drupal.org/node/1118100.
+    // bug: https://www.drupal.org/node/1118100.
     if (isset($this->extra)) {
       if (is_array($this->extra)) {
         $extras = [];
diff --git a/core/modules/views/src/Plugin/views/query/Sql.php b/core/modules/views/src/Plugin/views/query/Sql.php
index 96968b5e32b0..c6200bc16a96 100644
--- a/core/modules/views/src/Plugin/views/query/Sql.php
+++ b/core/modules/views/src/Plugin/views/query/Sql.php
@@ -834,7 +834,7 @@ public function addField($table, $field, $alias = '', $params = []) {
     $alias = $alias ? $alias : $field;
 
     // PostgreSQL truncates aliases to 63 characters:
-    //   https://www.drupal.org/node/571548.
+    // https://www.drupal.org/node/571548.
 
     // We limit the length of the original alias up to 60 characters
     // to get a unique alias later if its have duplicates
diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php
index 5abd76d18496..7637ec8f7406 100644
--- a/core/modules/views/src/ViewExecutable.php
+++ b/core/modules/views/src/ViewExecutable.php
@@ -1467,7 +1467,7 @@ public function render($display_id = NULL) {
 
     $module_handler = \Drupal::moduleHandler();
 
-    // @TODO In the longrun, it would be great to execute a view without
+    // @todo In the long run, it would be great to execute a view without
     //   the theme system at all. See https://www.drupal.org/node/2322623.
     $active_theme = \Drupal::theme()->getActiveTheme();
     $themes = array_keys($active_theme->getBaseThemeExtensions());
diff --git a/core/modules/views/tests/src/Functional/BulkFormTest.php b/core/modules/views/tests/src/Functional/BulkFormTest.php
index 85c0a4c132fd..b750fbb69d65 100644
--- a/core/modules/views/tests/src/Functional/BulkFormTest.php
+++ b/core/modules/views/tests/src/Functional/BulkFormTest.php
@@ -197,7 +197,7 @@ public function testBulkForm() {
 
     // Test that the bulk form works when multiple nodes are selected
     // but all of the selected nodes are already deleted
-    //  by another user before the loaded bulk form was submitted.
+    // by another user before the loaded bulk form was submitted.
     $this->drupalGet('test_bulk_form');
     // Call the node delete action.
     foreach ($nodes as $key => $node) {
diff --git a/core/modules/views/tests/src/Functional/Plugin/PagerTest.php b/core/modules/views/tests/src/Functional/Plugin/PagerTest.php
index a4bf0f55b76c..71d2b97ba28f 100644
--- a/core/modules/views/tests/src/Functional/Plugin/PagerTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/PagerTest.php
@@ -57,7 +57,7 @@ public function testStorePagerSettings() {
     ]);
     $this->drupalLogin($admin_user);
     // Test behavior described in
-    //   https://www.drupal.org/node/652712#comment-2354918.
+    // https://www.drupal.org/node/652712#comment-2354918.
 
     $this->drupalGet('admin/structure/views/view/test_view/edit');
 
@@ -136,7 +136,7 @@ public function testStorePagerSettings() {
     $this->assertSession()->pageTextContains('Mini');
 
     // Test behavior described in
-    //   https://www.drupal.org/node/652712#comment-2354400.
+    // https://www.drupal.org/node/652712#comment-2354400.
     $view = Views::getView('test_store_pager_settings');
     // Make it editable in the admin interface.
     $view->save();
diff --git a/core/modules/views/views.api.php b/core/modules/views/views.api.php
index e9b7513ab497..13dc8bb9203e 100644
--- a/core/modules/views/views.api.php
+++ b/core/modules/views/views.api.php
@@ -133,6 +133,7 @@ function hook_views_analyze(\Drupal\views\ViewExecutable $view) {
 function hook_views_data() {
   // This example describes how to write hook_views_data() for a table defined
   // like this:
+  // @code
   // CREATE TABLE example_table (
   //   nid INT(11) NOT NULL         COMMENT 'Primary key: {node}.nid.',
   //   plain_text_field VARCHAR(32) COMMENT 'Just a plain text field.',
@@ -142,6 +143,7 @@ function hook_views_data() {
   //   langcode VARCHAR(12)         COMMENT 'Language code field.',
   //   PRIMARY KEY(nid)
   // );
+  // @endcode
 
   // Define the return array.
   $data = [];
@@ -193,8 +195,10 @@ function hook_views_data() {
   //
   // If you've decided an automatic join is a good idea, here's how to do it;
   // the resulting SQL query will look something like this:
+  // @code
   //   ... FROM example_table et ... JOIN node_field_data nfd
   //   ON et.nid = nfd.nid AND ('extra' clauses will be here) ...
+  // @endcode
   // although the table aliases will be different.
   $data['example_table']['table']['join'] = [
     // Within the 'join' section, list one or more tables to automatically
@@ -243,10 +247,12 @@ function hook_views_data() {
   // shown above), you could join to 'node_field_table' via the 'foo' table.
   // Here's how to do this, and the resulting SQL query would look something
   // like this:
+  // @code
   //   ... FROM example_table et ... JOIN foo foo
   //   ON et.nid = foo.nid AND ('extra' clauses will be here) ...
   //   JOIN node_field_data nfd ON (definition of the join from the foo
   //   module goes here) ...
+  // @endcode
   // although the table aliases will be different.
   $data['example_table']['table']['join']['node_field_data'] = [
     // 'node_field_data' above is the base we're joining to in Views.
diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist
index 661496624d70..6fafc0de1a4d 100644
--- a/core/phpcs.xml.dist
+++ b/core/phpcs.xml.dist
@@ -86,12 +86,11 @@
     <exclude name="Drupal.Commenting.VariableComment.VarOrder"/>
   </rule>
   <rule ref="Drupal.Commenting.InlineComment">
-    <!-- Sniff for: NoSpaceBefore, WrongStyle -->
+    <!-- Sniff for: NoSpaceBefore, SpacingBefore, WrongStyle -->
     <exclude name="Drupal.Commenting.InlineComment.DocBlock"/>
     <exclude name="Drupal.Commenting.InlineComment.InvalidEndChar"/>
     <exclude name="Drupal.Commenting.InlineComment.NotCapital"/>
     <exclude name="Drupal.Commenting.InlineComment.SpacingAfter"/>
-    <exclude name="Drupal.Commenting.InlineComment.SpacingBefore"/>
   </rule>
   <rule ref="Drupal.Commenting.PostStatementComment"/>
   <rule ref="Drupal.ControlStructures.ElseIf"/>
diff --git a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php
index 23614c7a0e04..fa0ba28ed7ba 100644
--- a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php
+++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php
@@ -301,7 +301,7 @@ protected function runDbTasks() {
    */
   protected function replaceUser1() {
     /** @var \Drupal\user\UserInterface $account */
-    // @todo: Saving the account before the update is problematic.
+    // @todo Saving the account before the update is problematic.
     //   https://www.drupal.org/node/2560237
     $account = User::load(1);
     $account->setPassword($this->rootUser->pass_raw);
diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php
index 102d26c7223d..496887da3560 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php
@@ -33,10 +33,12 @@ public function testFromSubquerySelect() {
       $select->condition('task', 'code');
 
       // The resulting query should be equivalent to:
+      // @code
       // SELECT t.name
       // FROM (SELECT tt.pid AS pid, tt.task AS task FROM test_task tt WHERE priority=1) tt
       //   INNER JOIN test t ON t.id=tt.pid
       // WHERE tt.task = 'code'
+      // @endcode
       $people = $select->execute()->fetchCol();
 
       $this->assertCount(1, $people, 'Returned the correct number of rows.');
@@ -61,9 +63,11 @@ public function testFromSubquerySelectWithLimit() {
     $select->addField('t', 'name');
 
     // The resulting query should be equivalent to:
+    // @code
     // SELECT t.name
     // FROM (SELECT tt.pid AS pid, tt.task AS task FROM test_task tt ORDER BY priority DESC LIMIT 1 OFFSET 0) tt
     //   INNER JOIN test t ON t.id=tt.pid
+    // @endcode
     $people = $select->execute()->fetchCol();
 
     $this->assertCount(1, $people, 'Returned the correct number of rows.');
@@ -170,11 +174,13 @@ public function testConditionSubquerySelect4() {
     $select->condition($subquery1, [$subquery2, $subquery3], 'BETWEEN');
 
     // The resulting query should be equivalent to:
+    // @code
     // SELECT t.name AS name
     // FROM {test} t
     // WHERE (SELECT AVG(tt.priority) AS expression FROM {test_task} tt WHERE (tt.pid = t.id))
     //   BETWEEN (SELECT MIN(tt2.priority) AS expression FROM {test_task} tt2 WHERE (tt2.pid <> t.id))
     //       AND (SELECT AVG(tt3.priority) AS expression FROM {test_task} tt3 WHERE (tt3.pid <> t.id));
+    // @endcode
     $people = $select->execute()->fetchCol();
     $this->assertEqualsCanonicalizing(['George', 'Paul'], $people, 'Returned George and Paul.');
   }
@@ -195,9 +201,11 @@ public function testJoinSubquerySelect() {
     $select->addField('t', 'name');
 
     // The resulting query should be equivalent to:
+    // @code
     // SELECT t.name
     // FROM test t
     //   INNER JOIN (SELECT tt.pid AS pid FROM test_task tt WHERE priority=1) tt ON t.id=tt.pid
+    // @endcode
     $people = $select->execute()->fetchCol();
 
     $this->assertCount(2, $people, 'Returned the correct number of rows.');
diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php
index 780c9059e0cc..3cc63bcc1fc9 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBase.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBase.php
@@ -484,7 +484,7 @@ protected function initFileCache() {
     // Provide a default configuration, if not set.
     if (!isset($configuration['default'])) {
       // @todo Use extension_loaded('apcu') for non-testbot
-      //  https://www.drupal.org/node/2447753.
+      //   https://www.drupal.org/node/2447753.
       if (function_exists('apcu_fetch')) {
         $configuration['default']['cache_backend_class'] = ApcuFileCacheBackend::class;
       }
diff --git a/core/tests/Drupal/Tests/Component/Graph/GraphTest.php b/core/tests/Drupal/Tests/Component/Graph/GraphTest.php
index 0d64cbf0240a..9448e6cdc1bf 100644
--- a/core/tests/Drupal/Tests/Component/Graph/GraphTest.php
+++ b/core/tests/Drupal/Tests/Component/Graph/GraphTest.php
@@ -16,11 +16,13 @@ class GraphTest extends TestCase {
    */
   public function testDepthFirstSearch() {
     // The sample graph used is:
+    // @code
     // 1 --> 2 --> 3     5 ---> 6
     //       |     ^     ^
     //       |     |     |
     //       |     |     |
     //       +---> 4 <-- 7      8 ---> 9
+    // @endcode
     $graph = $this->normalizeGraph([
       1 => [2],
       2 => [3, 4],
diff --git a/core/tests/Drupal/Tests/Component/Utility/XssTest.php b/core/tests/Drupal/Tests/Component/Utility/XssTest.php
index 6fe1278dcb24..b0c434da5d7a 100644
--- a/core/tests/Drupal/Tests/Component/Utility/XssTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/XssTest.php
@@ -431,7 +431,7 @@ public function providerTestFilterXssNotNormalized() {
         ['p'],
       ],
     ];
-    // @fixme This dataset currently fails under 5.4 because of
+    // @todo This dataset currently fails under 5.4 because of
     //   https://www.drupal.org/node/1210798. Restore after its fixed.
     if (version_compare(PHP_VERSION, '5.4.0', '<')) {
       $cases[] = [
-- 
GitLab