diff --git a/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php b/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php
index 000c337db2..0a064b48b5 100644
--- a/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php
+++ b/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php
@@ -141,7 +141,7 @@ public function getDefinitions() {
               $finder = MockFileFinder::create($fileinfo->getPathName());
               $parser = new StaticReflectionParser($class, $finder, TRUE);
 
-              /** @var $annotation \Drupal\Component\Annotation\AnnotationInterface */
+              /** @var \Drupal\Component\Annotation\AnnotationInterface $annotation */
               if ($annotation = $reader->getClassAnnotation($parser->getReflectionClass(), $this->pluginDefinitionAnnotationName)) {
                 $this->prepareAnnotationDefinition($annotation, $class);
 
diff --git a/core/lib/Drupal/Core/Access/AccessManager.php b/core/lib/Drupal/Core/Access/AccessManager.php
index b7b7c0bfc1..7585fdf3f9 100644
--- a/core/lib/Drupal/Core/Access/AccessManager.php
+++ b/core/lib/Drupal/Core/Access/AccessManager.php
@@ -155,7 +155,7 @@ public function check(RouteMatchInterface $route_match, AccountInterface $accoun
   protected function performCheck($service_id, ArgumentsResolverInterface $arguments_resolver) {
     $callable = $this->checkProvider->loadCheck($service_id);
     $arguments = $arguments_resolver->getArguments($callable);
-    /** @var \Drupal\Core\Access\AccessResultInterface $service_access **/
+    /** @var \Drupal\Core\Access\AccessResultInterface $service_access */
     $service_access = call_user_func_array($callable, $arguments);
 
     if (!$service_access instanceof AccessResultInterface) {
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigDependencyDeleteFormTrait.php b/core/lib/Drupal/Core/Config/Entity/ConfigDependencyDeleteFormTrait.php
index 2ec87ddfac..6633357bd6 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigDependencyDeleteFormTrait.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigDependencyDeleteFormTrait.php
@@ -52,7 +52,7 @@ protected function addDependencyListsToForm(array &$form, $type, array $names, C
     ];
 
     foreach ($dependent_entities['update'] as $entity) {
-      /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface  $entity */
+      /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
       $entity_type_id = $entity->getEntityTypeId();
       if (!isset($form['entity_updates'][$entity_type_id])) {
         $entity_type = $entity_manager->getDefinition($entity_type_id);
diff --git a/core/lib/Drupal/Core/Datetime/Element/Datetime.php b/core/lib/Drupal/Core/Datetime/Element/Datetime.php
index d00547535b..d7aeac249b 100644
--- a/core/lib/Drupal/Core/Datetime/Element/Datetime.php
+++ b/core/lib/Drupal/Core/Datetime/Element/Datetime.php
@@ -28,11 +28,11 @@ public function getInfo() {
     // Date formats cannot be loaded during install or update.
     if (!defined('MAINTENANCE_MODE')) {
       if ($date_format_entity = DateFormat::load('html_date')) {
-        /** @var $date_format_entity \Drupal\Core\Datetime\DateFormatInterface */
+        /** @var \Drupal\Core\Datetime\DateFormatInterface $date_format_entity */
         $date_format = $date_format_entity->getPattern();
       }
       if ($time_format_entity = DateFormat::load('html_time')) {
-        /** @var $time_format_entity \Drupal\Core\Datetime\DateFormatInterface */
+        /** @var \Drupal\Core\Datetime\DateFormatInterface $time_format_entity */
         $time_format = $time_format_entity->getPattern();
       }
     }
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 217d4dc781..77cc22a0d8 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -1240,7 +1240,7 @@ protected function compileContainer() {
       $path = 'core/lib/Drupal/' . $parent_directory;
       $parent_namespace = 'Drupal\\' . $parent_directory;
       foreach (new \DirectoryIterator($this->root . '/' . $path) as $component) {
-        /** @var $component \DirectoryIterator */
+        /** @var \DirectoryIterator $component */
         $pathname = $component->getPathname();
         if (!$component->isDot() && $component->isDir() && (
           is_dir($pathname . '/Plugin') ||
diff --git a/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php b/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
index 466032d96a..ff0a990c69 100644
--- a/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
+++ b/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
@@ -156,7 +156,7 @@ public static function validateEntityAutocomplete(array &$element, FormStateInte
         'target_type' => $element['#target_type'],
         'handler' => $element['#selection_handler'],
       ];
-      /** @var /Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface $handler */
+      /** @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface $handler */
       $handler = \Drupal::service('plugin.manager.entity_reference_selection')->getInstance($options);
       $autocreate = (bool) $element['#autocreate'] && $handler instanceof SelectionWithAutocreateInterface;
 
diff --git a/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php b/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php
index ac364115eb..5cf415d872 100644
--- a/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php
+++ b/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php
@@ -74,7 +74,7 @@ public function access(EntityInterface $entity, $operation, AccountInterface $ac
     // individual revisions to have specific access control and be cached
     // separately.
     if ($entity instanceof RevisionableInterface) {
-      /** @var $entity \Drupal\Core\Entity\RevisionableInterface */
+      /** @var \Drupal\Core\Entity\RevisionableInterface $entity */
       $cid .= ':' . $entity->getRevisionId();
     }
 
diff --git a/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityTypeConstraintValidator.php b/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityTypeConstraintValidator.php
index 89c5e8ead7..acb000ad6b 100644
--- a/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityTypeConstraintValidator.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityTypeConstraintValidator.php
@@ -18,7 +18,7 @@ public function validate($entity, Constraint $constraint) {
       return;
     }
 
-    /** @var $entity \Drupal\Core\Entity\EntityInterface */
+    /** @var \Drupal\Core\Entity\EntityInterface $entity */
     if ($entity->getEntityTypeId() != $constraint->type) {
       $this->context->addViolation($constraint->message, ['%type' => $constraint->type]);
     }
diff --git a/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraintValidator.php b/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraintValidator.php
index 1e49ba12a3..1d0f9163a1 100644
--- a/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraintValidator.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraintValidator.php
@@ -93,7 +93,7 @@ public function validate($value, Constraint $constraint) {
 
     $entity = !empty($value->getParent()) ? $value->getEntity() : NULL;
 
-    /** @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface $handler * */
+    /** @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface $handler */
     $handler = $this->selectionManager->getSelectionHandler($value->getFieldDefinition(), $entity);
     $target_type_id = $value->getFieldDefinition()->getSetting('target_type');
 
diff --git a/core/lib/Drupal/Core/Entity/entity.api.php b/core/lib/Drupal/Core/Entity/entity.api.php
index 5387c7ef7e..16b0920fbc 100644
--- a/core/lib/Drupal/Core/Entity/entity.api.php
+++ b/core/lib/Drupal/Core/Entity/entity.api.php
@@ -666,7 +666,7 @@ function hook_ENTITY_TYPE_create_access(\Drupal\Core\Session\AccountInterface $a
  * @see hook_entity_type_alter()
  */
 function hook_entity_type_build(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   // Add a form for a custom node form without overriding the default
   // node form. To override the default node form, use hook_entity_type_alter().
   $entity_types['node']->setFormClass('mymodule_foo', 'Drupal\mymodule\NodeFooForm');
@@ -695,7 +695,7 @@ function hook_entity_type_build(array &$entity_types) {
  * @see \Drupal\Core\Entity\EntityTypeInterface
  */
 function hook_entity_type_alter(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   // Set the controller class for nodes to an alternate implementation of the
   // Drupal\Core\Entity\EntityStorageInterface interface.
   $entity_types['node']->setStorageClass('Drupal\mymodule\MyCustomNodeStorage');
diff --git a/core/lib/Drupal/Core/Extension/module.api.php b/core/lib/Drupal/Core/Extension/module.api.php
index 944d3547b7..dcf71590f6 100644
--- a/core/lib/Drupal/Core/Extension/module.api.php
+++ b/core/lib/Drupal/Core/Extension/module.api.php
@@ -721,7 +721,7 @@ function hook_post_update_NAME(&$sandbox) {
   $block_ids = array_keys($block_update_8001);
   $block_storage = \Drupal::entityManager()->getStorage('block');
   $blocks = $block_storage->loadMultiple($block_ids);
-  /** @var $blocks \Drupal\block\BlockInterface[] */
+  /** @var \Drupal\block\BlockInterface[] $blocks */
   foreach ($blocks as $block) {
     // This block has had conditions removed due to an inability to resolve
     // contexts in block_update_8001() so disable it.
diff --git a/core/lib/Drupal/Core/Field/FieldConfigBase.php b/core/lib/Drupal/Core/Field/FieldConfigBase.php
index e53e84b6c8..6e61775e52 100644
--- a/core/lib/Drupal/Core/Field/FieldConfigBase.php
+++ b/core/lib/Drupal/Core/Field/FieldConfigBase.php
@@ -231,7 +231,7 @@ public function calculateDependencies() {
     // Add dependencies from the field type plugin. We can not use
     // self::calculatePluginDependencies() because instantiation of a field item
     // plugin requires a parent entity.
-    /** @var $field_type_manager \Drupal\Core\Field\FieldTypePluginManagerInterface */
+    /** @var \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager */
     $field_type_manager = \Drupal::service('plugin.manager.field.field_type');
     $definition = $field_type_manager->getDefinition($this->getType());
     $this->addDependency('module', $definition['provider']);
diff --git a/core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php b/core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php
index 679e6db00b..c20d42c718 100644
--- a/core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php
+++ b/core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php
@@ -26,7 +26,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $install_
     $profiles = [];
     $names = [];
     foreach ($install_state['profiles'] as $profile) {
-      /** @var $profile \Drupal\Core\Extension\Extension */
+      /** @var \Drupal\Core\Extension\Extension $profile */
       $details = install_profile_info($profile->getName());
       // Don't show hidden profiles. This is used by to hide the testing profile,
       // which only exists to speed up test runs.
diff --git a/core/lib/Drupal/Core/Link.php b/core/lib/Drupal/Core/Link.php
index e435d44279..80dd2c248f 100644
--- a/core/lib/Drupal/Core/Link.php
+++ b/core/lib/Drupal/Core/Link.php
@@ -10,9 +10,7 @@
  */
 class Link implements RenderableInterface {
 
-  /**
-   * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
-   */
+  // @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
   use LinkGeneratorTrait;
 
   /**
diff --git a/core/lib/Drupal/Core/Menu/ContextualLinkManager.php b/core/lib/Drupal/Core/Menu/ContextualLinkManager.php
index 057f7ded40..5b8b609b81 100644
--- a/core/lib/Drupal/Core/Menu/ContextualLinkManager.php
+++ b/core/lib/Drupal/Core/Menu/ContextualLinkManager.php
@@ -167,7 +167,7 @@ public function getContextualLinksArrayByGroup($group_name, array $route_paramet
     $links = [];
     $request = $this->requestStack->getCurrentRequest();
     foreach ($this->getContextualLinkPluginsByGroup($group_name) as $plugin_id => $plugin_definition) {
-      /** @var $plugin \Drupal\Core\Menu\ContextualLinkInterface */
+      /** @var \Drupal\Core\Menu\ContextualLinkInterface $plugin */
       $plugin = $this->createInstance($plugin_id);
       $route_name = $plugin->getRouteName();
 
diff --git a/core/lib/Drupal/Core/Menu/LocalActionManager.php b/core/lib/Drupal/Core/Menu/LocalActionManager.php
index f262d4724d..236c48989e 100644
--- a/core/lib/Drupal/Core/Menu/LocalActionManager.php
+++ b/core/lib/Drupal/Core/Menu/LocalActionManager.php
@@ -176,7 +176,7 @@ public function getActionsForRoute($route_appears) {
       }
     }
     $links = [];
-    /** @var $plugin \Drupal\Core\Menu\LocalActionInterface */
+    /** @var \Drupal\Core\Menu\LocalActionInterface $plugin */
     foreach ($this->instances[$route_appears] as $plugin_id => $plugin) {
       $cacheability = new CacheableMetadata();
       $route_name = $plugin->getRouteName();
diff --git a/core/lib/Drupal/Core/Menu/LocalTaskManager.php b/core/lib/Drupal/Core/Menu/LocalTaskManager.php
index 1046a9f13b..e7bc569362 100644
--- a/core/lib/Drupal/Core/Menu/LocalTaskManager.php
+++ b/core/lib/Drupal/Core/Menu/LocalTaskManager.php
@@ -304,7 +304,7 @@ public function getTasksBuild($current_route_name, RefinableCacheableDependencyI
     }
 
     foreach ($tree as $level => $instances) {
-      /** @var $instances \Drupal\Core\Menu\LocalTaskInterface[] */
+      /** @var \Drupal\Core\Menu\LocalTaskInterface[] $instances */
       foreach ($instances as $plugin_id => $child) {
         $route_name = $child->getRouteName();
         $route_parameters = $child->getRouteParameters($this->routeMatch);
diff --git a/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php b/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php
index cad7609c83..7c50fa78a5 100644
--- a/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php
+++ b/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php
@@ -74,7 +74,7 @@ public function setRouteParameterConverters(RouteCollection $routes) {
    * {@inheritdoc}
    */
   public function convert(array $defaults) {
-    /** @var $route \Symfony\Component\Routing\Route */
+    /** @var \Symfony\Component\Routing\Route $route */
     $route = $defaults[RouteObjectInterface::ROUTE_OBJECT];
 
     // Skip this enhancer if there are no parameter definitions.
diff --git a/core/lib/Drupal/Core/Plugin/Context/ContextHandler.php b/core/lib/Drupal/Core/Plugin/Context/ContextHandler.php
index 2a13d364d7..84eb73365e 100644
--- a/core/lib/Drupal/Core/Plugin/Context/ContextHandler.php
+++ b/core/lib/Drupal/Core/Plugin/Context/ContextHandler.php
@@ -67,7 +67,7 @@ public function getMatchingContexts(array $contexts, ContextDefinitionInterface
    * {@inheritdoc}
    */
   public function applyContextMapping(ContextAwarePluginInterface $plugin, $contexts, $mappings = []) {
-    /** @var $contexts \Drupal\Core\Plugin\Context\ContextInterface[] */
+    /** @var \Drupal\Core\Plugin\Context\ContextInterface[] $contexts */
     $mappings += $plugin->getContextMapping();
     // Loop through each of the expected contexts.
 
diff --git a/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php b/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php
index 80f10d2021..f564e5fde6 100644
--- a/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php
+++ b/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php
@@ -132,7 +132,7 @@ public function getCacheContexts() {
     // Applied contexts can affect the cache contexts when this plugin is
     // involved in caching, collect and return them.
     foreach ($this->getContexts() as $context) {
-      /** @var $context \Drupal\Core\Cache\CacheableDependencyInterface */
+      /** @var \Drupal\Core\Cache\CacheableDependencyInterface $context */
       if ($context instanceof CacheableDependencyInterface) {
         $cache_contexts = Cache::mergeContexts($cache_contexts, $context->getCacheContexts());
       }
@@ -148,7 +148,7 @@ public function getCacheTags() {
     // Applied contexts can affect the cache tags when this plugin is
     // involved in caching, collect and return them.
     foreach ($this->getContexts() as $context) {
-      /** @var $context \Drupal\Core\Cache\CacheableDependencyInterface */
+      /** @var \Drupal\Core\Cache\CacheableDependencyInterface $context */
       if ($context instanceof CacheableDependencyInterface) {
         $tags = Cache::mergeTags($tags, $context->getCacheTags());
       }
@@ -165,7 +165,7 @@ public function getCacheMaxAge() {
     // Applied contexts can affect the cache max age when this plugin is
     // involved in caching, collect and return them.
     foreach ($this->getContexts() as $context) {
-      /** @var $context \Drupal\Core\Cache\CacheableDependencyInterface */
+      /** @var \Drupal\Core\Cache\CacheableDependencyInterface $context */
       if ($context instanceof CacheableDependencyInterface) {
         $max_age = Cache::mergeMaxAges($max_age, $context->getCacheMaxAge());
       }
diff --git a/core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php b/core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php
index 09d6148118..6f94a1d7f0 100644
--- a/core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php
+++ b/core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php
@@ -56,7 +56,7 @@ public function enhance(array $defaults, Request $request) {
    * @return \Symfony\Component\HttpFoundation\ParameterBag
    */
   protected function copyRawVariables(array $defaults) {
-    /** @var $route \Symfony\Component\Routing\Route */
+    /** @var \Symfony\Component\Routing\Route $route */
     $route = $defaults[RouteObjectInterface::ROUTE_OBJECT];
     $variables = array_flip($route->compile()->getVariables());
     // Foreach will copy the values from the array it iterates. Even if they
diff --git a/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php b/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php
index 356fe3e6fa..e79627c93f 100644
--- a/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php
+++ b/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php
@@ -52,7 +52,7 @@ public function __construct($service_ids) {
    *   A collection of routes to apply enhancer checks to.
    */
   public function setEnhancers(RouteCollection $route_collection) {
-    /** @var \Symfony\Component\Routing\Route $route **/
+    /** @var \Symfony\Component\Routing\Route $route */
     foreach ($route_collection as $route_name => $route) {
       $service_ids = [];
       foreach ($this->getEnhancers() as $service_id => $enhancer) {
diff --git a/core/lib/Drupal/Core/Routing/LazyRouteFilter.php b/core/lib/Drupal/Core/Routing/LazyRouteFilter.php
index 10f3d517be..9e8192a783 100644
--- a/core/lib/Drupal/Core/Routing/LazyRouteFilter.php
+++ b/core/lib/Drupal/Core/Routing/LazyRouteFilter.php
@@ -51,7 +51,7 @@ public function __construct($service_ids) {
    *   A collection of routes to apply filter checks to.
    */
   public function setFilters(RouteCollection $route_collection) {
-    /** @var \Symfony\Component\Routing\Route $route **/
+    /** @var \Symfony\Component\Routing\Route $route */
     foreach ($route_collection as $route) {
       $service_ids = [];
       foreach ($this->getFilters() as $service_id => $filter) {
diff --git a/core/modules/action/action.module b/core/modules/action/action.module
index 5004a84b11..1b397ca97e 100644
--- a/core/modules/action/action.module
+++ b/core/modules/action/action.module
@@ -38,7 +38,7 @@ function action_help($route_name, RouteMatchInterface $route_match) {
  * Implements hook_entity_type_build().
  */
 function action_entity_type_build(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   $entity_types['action']
     ->setFormClass('add', 'Drupal\action\ActionAddForm')
     ->setFormClass('edit', 'Drupal\action\ActionEditForm')
diff --git a/core/modules/action/tests/src/Functional/ActionListTest.php b/core/modules/action/tests/src/Functional/ActionListTest.php
index 309160f4be..e9491388f0 100644
--- a/core/modules/action/tests/src/Functional/ActionListTest.php
+++ b/core/modules/action/tests/src/Functional/ActionListTest.php
@@ -26,7 +26,7 @@ public function testEmptyActionList() {
     $this->drupalLogin($this->drupalCreateUser(['administer actions']));
 
     // Ensure the empty text appears on the action list page.
-    /** @var $storage \Drupal\Core\Entity\EntityStorageInterface */
+    /** @var \Drupal\Core\Entity\EntityStorageInterface $storage */
     $storage = $this->container->get('entity.manager')->getStorage('action');
     $actions  = $storage->loadMultiple();
     $storage->delete($actions);
diff --git a/core/modules/aggregator/src/Tests/AggregatorTestBase.php b/core/modules/aggregator/src/Tests/AggregatorTestBase.php
index f42248975a..7bfe62067a 100644
--- a/core/modules/aggregator/src/Tests/AggregatorTestBase.php
+++ b/core/modules/aggregator/src/Tests/AggregatorTestBase.php
@@ -249,9 +249,7 @@ public function getValidOpml(array $feeds) {
     foreach ($feeds as &$feed) {
       $feed['url[0][value]'] = Html::escape($feed['url[0][value]']);
     }
-    /**
-     * Does not have an XML declaration, must pass the parser.
-     */
+    // Does not have an XML declaration, must pass the parser.
     $opml = <<<EOF
 <opml version="1.0">
   <head></head>
diff --git a/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php b/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php
index ddd98bb82f..07ef25ffe3 100644
--- a/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php
+++ b/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php
@@ -246,9 +246,7 @@ public function getValidOpml(array $feeds) {
     foreach ($feeds as &$feed) {
       $feed['url[0][value]'] = Html::escape($feed['url[0][value]']);
     }
-    /**
-     * Does not have an XML declaration, must pass the parser.
-     */
+    // Does not have an XML declaration, must pass the parser.
     $opml = <<<EOF
 <opml version="1.0">
   <head></head>
diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index ee6a4a11ea..a88576f0c8 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -240,7 +240,7 @@ function template_preprocess_block(&$variables) {
  */
 function block_user_role_delete($role) {
   foreach (Block::loadMultiple() as $block) {
-    /** @var $block \Drupal\block\BlockInterface */
+    /** @var \Drupal\block\BlockInterface $block */
     $visibility = $block->getVisibility();
     if (isset($visibility['user_role']['roles'][$role->id()])) {
       unset($visibility['user_role']['roles'][$role->id()]);
@@ -271,7 +271,7 @@ function block_menu_delete(Menu $menu) {
 function block_configurable_language_delete(ConfigurableLanguageInterface $language) {
   // Remove the block visibility settings for the deleted language.
   foreach (Block::loadMultiple() as $block) {
-    /** @var $block \Drupal\block\BlockInterface */
+    /** @var \Drupal\block\BlockInterface $block */
     $visibility = $block->getVisibility();
     if (isset($visibility['language']['langcodes'][$language->id()])) {
       unset($visibility['language']['langcodes'][$language->id()]);
diff --git a/core/modules/block/block.post_update.php b/core/modules/block/block.post_update.php
index d5f0852a3c..98cc81ce2b 100644
--- a/core/modules/block/block.post_update.php
+++ b/core/modules/block/block.post_update.php
@@ -32,7 +32,7 @@ function block_post_update_disable_blocks_with_missing_contexts() {
   $block_ids = array_keys($block_update_8001);
   $block_storage = \Drupal::entityManager()->getStorage('block');
   $blocks = $block_storage->loadMultiple($block_ids);
-  /** @var $blocks \Drupal\block\BlockInterface[] */
+  /** @var \Drupal\block\BlockInterface[] $blocks */
   foreach ($blocks as $block) {
     // This block has had conditions removed due to an inability to resolve
     // contexts in block_update_8001() so disable it.
diff --git a/core/modules/block/src/Plugin/DisplayVariant/BlockPageVariant.php b/core/modules/block/src/Plugin/DisplayVariant/BlockPageVariant.php
index 2dad5e6a34..65863be405 100644
--- a/core/modules/block/src/Plugin/DisplayVariant/BlockPageVariant.php
+++ b/core/modules/block/src/Plugin/DisplayVariant/BlockPageVariant.php
@@ -135,7 +135,7 @@ public function build() {
     // Load all region content assigned via blocks.
     $cacheable_metadata_list = [];
     foreach ($this->blockRepository->getVisibleBlocksPerRegion($cacheable_metadata_list) as $region => $blocks) {
-      /** @var $blocks \Drupal\block\BlockInterface[] */
+      /** @var \Drupal\block\BlockInterface[] $blocks */
       foreach ($blocks as $key => $block) {
         $block_plugin = $block->getPlugin();
         if ($block_plugin instanceof MainContentBlockPluginInterface) {
diff --git a/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareBlock.php b/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareBlock.php
index 7db350da81..678b6b0969 100644
--- a/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareBlock.php
+++ b/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareBlock.php
@@ -23,7 +23,7 @@ class TestContextAwareBlock extends BlockBase {
    * {@inheritdoc}
    */
   public function build() {
-    /** @var $user \Drupal\user\UserInterface */
+    /** @var \Drupal\user\UserInterface $user */
     $user = $this->getContextValue('user');
     return [
       '#prefix' => '<div id="' . $this->getPluginId() . '--username">',
diff --git a/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php b/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php
index 48d63a302d..d8ab92cce0 100644
--- a/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php
+++ b/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php
@@ -42,7 +42,7 @@ public function testBlockInterface() {
       'display_message' => 'no message set',
     ];
     // Initial configuration of the block at construction time.
-    /** @var $display_block \Drupal\Core\Block\BlockPluginInterface */
+    /** @var \Drupal\Core\Block\BlockPluginInterface $display_block */
     $display_block = $manager->createInstance('test_block_instantiation', $configuration);
     $this->assertIdentical($display_block->getConfiguration(), $expected_configuration, 'The block was configured correctly.');
 
diff --git a/core/modules/block_content/block_content.module b/core/modules/block_content/block_content.module
index 3adc979d9f..8d2b345b42 100644
--- a/core/modules/block_content/block_content.module
+++ b/core/modules/block_content/block_content.module
@@ -55,7 +55,7 @@ function block_content_theme($existing, $type, $theme, $path) {
  * Implements hook_entity_type_alter().
  */
 function block_content_entity_type_alter(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   // Add a translation handler for fields if the language module is enabled.
   if (\Drupal::moduleHandler()->moduleExists('language')) {
     $translation = $entity_types['block_content']->get('translation');
diff --git a/core/modules/block_content/src/Plugin/Derivative/BlockContent.php b/core/modules/block_content/src/Plugin/Derivative/BlockContent.php
index 25806c5f13..4bb96badb5 100644
--- a/core/modules/block_content/src/Plugin/Derivative/BlockContent.php
+++ b/core/modules/block_content/src/Plugin/Derivative/BlockContent.php
@@ -46,7 +46,7 @@ public function getDerivativeDefinitions($base_plugin_definition) {
     $block_contents = $this->blockContentStorage->loadMultiple();
     // Reset the discovered definitions.
     $this->derivatives = [];
-    /** @var $block_content \Drupal\block_content\Entity\BlockContent */
+    /** @var \Drupal\block_content\Entity\BlockContent $block_content */
     foreach ($block_contents as $block_content) {
       $this->derivatives[$block_content->uuid()] = $base_plugin_definition;
       $this->derivatives[$block_content->uuid()]['admin_label'] = $block_content->label();
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php b/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php
index fa88c64c26..71e6270c6e 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php
@@ -69,7 +69,7 @@ public function testRevisions() {
 
     foreach ($blocks as $delta => $revision_id) {
       // Confirm the correct revision text appears.
-      /** @var \Drupal\block_content\BlockContentInterface  $loaded */
+      /** @var \Drupal\block_content\BlockContentInterface $loaded */
       $loaded = $this->container->get('entity_type.manager')
         ->getStorage('block_content')
         ->loadRevision($revision_id);
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index 4c62274271..de44205eb2 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -78,7 +78,7 @@ function book_theme() {
  * Implements hook_entity_type_build().
  */
 function book_entity_type_build(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   $entity_types['node']
     ->setFormClass('book_outline', 'Drupal\book\Form\BookOutlineForm')
     ->setLinkTemplate('book-outline-form', '/node/{node}/outline')
diff --git a/core/modules/comment/comment.tokens.inc b/core/modules/comment/comment.tokens.inc
index 884144196a..bf3a39a3de 100644
--- a/core/modules/comment/comment.tokens.inc
+++ b/core/modules/comment/comment.tokens.inc
@@ -251,7 +251,7 @@ function comment_tokens($type, $tokens, array $data, array $options, BubbleableM
   }
   // Replacement tokens for any content entities that have comment field.
   elseif (!empty($data[$type]) && $data[$type] instanceof FieldableEntityInterface) {
-    /** @var $entity \Drupal\Core\Entity\FieldableEntityInterface */
+    /** @var \Drupal\Core\Entity\FieldableEntityInterface $entity */
     $entity = $data[$type];
 
     foreach ($tokens as $name => $original) {
diff --git a/core/modules/comment/src/Form/CommentAdminOverview.php b/core/modules/comment/src/Form/CommentAdminOverview.php
index b18bf3d0b0..9ccdf511a7 100644
--- a/core/modules/comment/src/Form/CommentAdminOverview.php
+++ b/core/modules/comment/src/Form/CommentAdminOverview.php
@@ -164,7 +164,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $type = '
       ->pager(50)
       ->execute();
 
-    /** @var $comments \Drupal\comment\CommentInterface[] */
+    /** @var \Drupal\comment\CommentInterface[] $comments */
     $comments = $this->commentStorage->loadMultiple($cids);
 
     // Build a table listing the appropriate comments.
@@ -185,7 +185,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $type = '
     }
 
     foreach ($comments as $comment) {
-      /** @var $commented_entity \Drupal\Core\Entity\EntityInterface */
+      /** @var \Drupal\Core\Entity\EntityInterface $commented_entity */
       $commented_entity = $commented_entities[$comment->getCommentedEntityTypeId()][$comment->getCommentedEntityId()];
       $comment_permalink = $comment->permalink();
       if ($comment->hasField('comment_body') && ($body = $comment->get('comment_body')->value)) {
diff --git a/core/modules/comment/src/Plugin/Field/FieldFormatter/AuthorNameFormatter.php b/core/modules/comment/src/Plugin/Field/FieldFormatter/AuthorNameFormatter.php
index 3e22ede6e3..eb990dad53 100644
--- a/core/modules/comment/src/Plugin/Field/FieldFormatter/AuthorNameFormatter.php
+++ b/core/modules/comment/src/Plugin/Field/FieldFormatter/AuthorNameFormatter.php
@@ -27,7 +27,7 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
     $elements = [];
 
     foreach ($items as $delta => $item) {
-      /** @var $comment \Drupal\comment\CommentInterface */
+      /** @var \Drupal\comment\CommentInterface $comment */
       $comment = $item->getEntity();
       $account = $comment->getOwner();
       $elements[$delta] = [
diff --git a/core/modules/comment/src/Plugin/views/row/Rss.php b/core/modules/comment/src/Plugin/views/row/Rss.php
index cb9c1046d1..8ca22966e4 100644
--- a/core/modules/comment/src/Plugin/views/row/Rss.php
+++ b/core/modules/comment/src/Plugin/views/row/Rss.php
@@ -73,7 +73,7 @@ public function render($row) {
     }
 
     // Load the specified comment and its associated node:
-    /** @var $comment \Drupal\comment\CommentInterface */
+    /** @var \Drupal\comment\CommentInterface $comment */
     $comment = $this->comments[$cid];
     if (empty($comment)) {
       return;
diff --git a/core/modules/comment/tests/modules/comment_test/comment_test.module b/core/modules/comment/tests/modules/comment_test/comment_test.module
index b1cca02f25..3b5437e2ac 100644
--- a/core/modules/comment/tests/modules/comment_test/comment_test.module
+++ b/core/modules/comment/tests/modules/comment_test/comment_test.module
@@ -13,7 +13,7 @@
  * Implements hook_entity_type_alter().
  */
 function comment_test_entity_type_alter(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   if (\Drupal::languageManager()->isMultilingual()) {
     // Enable language handling for comment fields.
     $translation = $entity_types['comment']->get('translation');
diff --git a/core/modules/config/tests/config_entity_static_cache_test/config_entity_static_cache_test.module b/core/modules/config/tests/config_entity_static_cache_test/config_entity_static_cache_test.module
index 9a5e3eb414..5e613706bb 100644
--- a/core/modules/config/tests/config_entity_static_cache_test/config_entity_static_cache_test.module
+++ b/core/modules/config/tests/config_entity_static_cache_test/config_entity_static_cache_test.module
@@ -26,6 +26,6 @@ function config_entity_static_cache_test_config_test_load($entities) {
  * Implements hook_entity_type_alter().
  */
 function config_entity_static_cache_test_entity_type_alter(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   $entity_types['config_test']->set('static_cache', TRUE);
 }
diff --git a/core/modules/config/tests/config_test/config_test.module b/core/modules/config/tests/config_test/config_test.module
index 5008575425..7f4983230c 100644
--- a/core/modules/config/tests/config_test/config_test.module
+++ b/core/modules/config/tests/config_test/config_test.module
@@ -19,7 +19,7 @@ function config_test_cache_flush() {
  * Implements hook_entity_type_alter().
  */
 function config_test_entity_type_alter(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   // The 'translatable' entity key is not supposed to change over time. In this
   // case we can safely do it because we set it once and we do not change it for
   // all the duration of the test session.
diff --git a/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module
index 344d90e27b..22dfcc063b 100644
--- a/core/modules/config_translation/config_translation.module
+++ b/core/modules/config_translation/config_translation.module
@@ -74,7 +74,7 @@ function config_translation_themes_uninstalled() {
  * Implements hook_entity_type_alter().
  */
 function config_translation_entity_type_alter(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   foreach ($entity_types as $entity_type_id => $entity_type) {
     if ($entity_type->entityClassImplements(ConfigEntityInterface::class)) {
       if ($entity_type_id == 'block') {
diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module
index 65e7592cce..e2b44789ee 100644
--- a/core/modules/contact/contact.module
+++ b/core/modules/contact/contact.module
@@ -42,7 +42,7 @@ function contact_help($route_name, RouteMatchInterface $route_match) {
  * Implements hook_entity_type_alter().
  */
 function contact_entity_type_alter(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   $entity_types['user']->setLinkTemplate('contact-form', '/user/{user}/contact');
 }
 
@@ -114,7 +114,7 @@ function contact_menu_local_tasks_alter(&$data, $route_name) {
  */
 function contact_mail($key, &$message, $params) {
   $contact_message = $params['contact_message'];
-  /** @var $sender \Drupal\user\UserInterface */
+  /** @var \Drupal\user\UserInterface $sender */
   $sender = $params['sender'];
   $language = \Drupal::languageManager()->getLanguage($message['langcode']);
 
diff --git a/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module b/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module
index cef976c6ff..155bf9a1f3 100644
--- a/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module
+++ b/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module
@@ -32,7 +32,7 @@ function contact_storage_test_entity_base_field_info(EntityTypeInterface $entity
  * Implements hook_entity_type_alter().
  */
 function contact_storage_test_entity_type_alter(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   // Set the controller class for nodes to an alternate implementation of the
   // Drupal\Core\Entity\EntityStorageInterface interface.
   $entity_types['contact_message']->setStorageClass('\Drupal\Core\Entity\Sql\SqlContentEntityStorage');
diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module
index 8dbd1702af..6cc073fd19 100644
--- a/core/modules/content_translation/content_translation.module
+++ b/core/modules/content_translation/content_translation.module
@@ -119,7 +119,7 @@ function content_translation_language_types_info_alter(array &$language_types) {
  */
 function content_translation_entity_type_alter(array &$entity_types) {
   // Provide defaults for translation info.
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   foreach ($entity_types as $entity_type) {
     if ($entity_type->isTranslatable()) {
       if (!$entity_type->hasHandlerClass('translation')) {
diff --git a/core/modules/content_translation/src/ContentTranslationUpdatesManager.php b/core/modules/content_translation/src/ContentTranslationUpdatesManager.php
index 4fa54f3eef..65a25e4c92 100644
--- a/core/modules/content_translation/src/ContentTranslationUpdatesManager.php
+++ b/core/modules/content_translation/src/ContentTranslationUpdatesManager.php
@@ -58,7 +58,7 @@ public function updateDefinitions(array $entity_types) {
         $storage_definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id);
         $installed_storage_definitions = $this->entityManager->getLastInstalledFieldStorageDefinitions($entity_type_id);
         foreach (array_diff_key($storage_definitions, $installed_storage_definitions) as $storage_definition) {
-          /** @var $storage_definition \Drupal\Core\Field\FieldStorageDefinitionInterface */
+          /** @var \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition */
           if ($storage_definition->getProvider() == 'content_translation') {
             $this->updateManager->installFieldStorageDefinition($storage_definition->getName(), $entity_type_id, 'content_translation', $storage_definition);
           }
diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module
index e9f1a88e65..ba9abb97cc 100644
--- a/core/modules/editor/editor.module
+++ b/core/modules/editor/editor.module
@@ -168,7 +168,7 @@ function editor_form_filter_format_form_alter(&$form, FormStateInterface $form_s
 
   // Add editor-specific validation and submit handlers.
   if ($editor) {
-    /** @var $plugin \Drupal\editor\Plugin\EditorPluginInterface */
+    /** @var \Drupal\editor\Plugin\EditorPluginInterface $plugin */
     $plugin = $manager->createInstance($editor->getEditor());
     $settings_form = [];
     $settings_form['#element_validate'][] = [$plugin, 'validateConfigurationForm'];
diff --git a/core/modules/field/src/FieldConfigAccessControlHandler.php b/core/modules/field/src/FieldConfigAccessControlHandler.php
index 6ee0e05cb6..d3a297430a 100644
--- a/core/modules/field/src/FieldConfigAccessControlHandler.php
+++ b/core/modules/field/src/FieldConfigAccessControlHandler.php
@@ -24,7 +24,7 @@ protected function checkAccess(EntityInterface $entity, $operation, AccountInter
     // a certain field storage config entity, it should also be allowed for all
     // associated field config entities.
     // @see \Drupal\Core\Field\FieldDefinitionInterface
-    /** \Drupal\field\FieldConfigInterface $entity */
+    /** @var \Drupal\field\FieldConfigInterface $entity */
     $field_storage_entity = $entity->getFieldStorageDefinition();
     return $field_storage_entity->access($operation, $account, TRUE);
   }
diff --git a/core/modules/field/src/FieldStorageConfigAccessControlHandler.php b/core/modules/field/src/FieldStorageConfigAccessControlHandler.php
index da48556fab..bfa09a30ca 100644
--- a/core/modules/field/src/FieldStorageConfigAccessControlHandler.php
+++ b/core/modules/field/src/FieldStorageConfigAccessControlHandler.php
@@ -18,7 +18,7 @@ class FieldStorageConfigAccessControlHandler extends EntityAccessControlHandler
    * {@inheritdoc}
    */
   protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
-    /** \Drupal\field\FieldStorageConfigInterface $entity */
+    /** @var \Drupal\field\FieldStorageConfigInterface $entity */
     if ($operation === 'delete') {
       if ($entity->isLocked()) {
         return AccessResult::forbidden()->addCacheableDependency($entity);
diff --git a/core/modules/field/tests/modules/field_test/field_test.entity.inc b/core/modules/field/tests/modules/field_test/field_test.entity.inc
index ee831ff2b6..3950ad59f9 100644
--- a/core/modules/field/tests/modules/field_test/field_test.entity.inc
+++ b/core/modules/field/tests/modules/field_test/field_test.entity.inc
@@ -9,7 +9,7 @@
  * Implements hook_entity_type_alter().
  */
 function field_test_entity_type_alter(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   foreach (field_test_entity_info_translatable() as $entity_type => $translatable) {
     $entity_types[$entity_type]->set('translatable', $translatable);
   }
diff --git a/core/modules/field/tests/src/Functional/Update/EntityReferenceHandlerSettingUpdateTest.php b/core/modules/field/tests/src/Functional/Update/EntityReferenceHandlerSettingUpdateTest.php
index 0fade3760f..7ab13ea20e 100644
--- a/core/modules/field/tests/src/Functional/Update/EntityReferenceHandlerSettingUpdateTest.php
+++ b/core/modules/field/tests/src/Functional/Update/EntityReferenceHandlerSettingUpdateTest.php
@@ -30,7 +30,7 @@ public function testFieldPostUpdateERHandlerSetting() {
 
     // Load the 'node.article.field_image' field config, and check that its
     // 'handler' setting is wrong.
-    /** @var \Drupal\Core\Config\Config */
+    /** @var \Drupal\Core\Config\Config $config */
     $config = $configFactory->get('field.field.node.article.field_image');
     $settings = $config->get('settings');
     $this->assertEqual($settings['handler'], 'default:node');
diff --git a/core/modules/field_layout/field_layout.module b/core/modules/field_layout/field_layout.module
index 5a5fa11a49..96a452c1d5 100644
--- a/core/modules/field_layout/field_layout.module
+++ b/core/modules/field_layout/field_layout.module
@@ -34,7 +34,7 @@ function field_layout_help($route_name, RouteMatchInterface $route_match) {
  * Implements hook_entity_type_alter().
  */
 function field_layout_entity_type_alter(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   $entity_types['entity_view_display']->setClass(FieldLayoutEntityViewDisplay::class);
   $entity_types['entity_form_display']->setClass(FieldLayoutEntityFormDisplay::class);
 
diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module
index 79b3f151a5..6609335475 100644
--- a/core/modules/field_ui/field_ui.module
+++ b/core/modules/field_ui/field_ui.module
@@ -70,7 +70,7 @@ function field_ui_theme() {
  * Implements hook_entity_type_build().
  */
 function field_ui_entity_type_build(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   $entity_types['field_config']->setFormClass('edit', 'Drupal\field_ui\Form\FieldConfigEditForm');
   $entity_types['field_config']->setFormClass('delete', 'Drupal\field_ui\Form\FieldConfigDeleteForm');
   $entity_types['field_config']->setListBuilderClass('Drupal\field_ui\FieldConfigListBuilder');
diff --git a/core/modules/file/src/Tests/FileManagedFileElementTest.php b/core/modules/file/src/Tests/FileManagedFileElementTest.php
index 1ff00b90d9..5c4a57c99c 100644
--- a/core/modules/file/src/Tests/FileManagedFileElementTest.php
+++ b/core/modules/file/src/Tests/FileManagedFileElementTest.php
@@ -184,7 +184,7 @@ public function testFileRemovedFromDisk() {
     $this->drupalPostForm(NULL, [], t('Save'));
 
     $fid = $this->getLastFileId();
-    /** @var $file \Drupal\file\FileInterface */
+    /** @var \Drupal\file\FileInterface $file */
     $file = $this->container->get('entity_type.manager')->getStorage('file')->load($fid);
     $file->setPermanent();
     $file->save();
diff --git a/core/modules/file/tests/file_test/file_test.module b/core/modules/file/tests/file_test/file_test.module
index 0baa0cbd08..83fb392930 100644
--- a/core/modules/file/tests/file_test/file_test.module
+++ b/core/modules/file/tests/file_test/file_test.module
@@ -344,7 +344,7 @@ function file_test_file_scan_callback_reset() {
  */
 function file_test_entity_type_alter(&$entity_types) {
   if (\Drupal::state()->get('file_test_alternate_access_handler', FALSE)) {
-    /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+    /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
     $entity_types['file']
       ->setAccessClass('Drupal\file_test\FileTestAccessControlHandler');
   }
diff --git a/core/modules/filter/src/Element/ProcessedText.php b/core/modules/filter/src/Element/ProcessedText.php
index 6e2b3ec43e..6a24a369ba 100644
--- a/core/modules/filter/src/Element/ProcessedText.php
+++ b/core/modules/filter/src/Element/ProcessedText.php
@@ -71,7 +71,7 @@ public static function preRenderText($element) {
     if (!isset($format_id)) {
       $format_id = static::configFactory()->get('filter.settings')->get('fallback_format');
     }
-    /** @var \Drupal\filter\Entity\FilterFormat $format **/
+    /** @var \Drupal\filter\Entity\FilterFormat $format */
     $format = FilterFormat::load($format_id);
     // If the requested text format doesn't exist or its disabled, the text
     // cannot be filtered.
@@ -95,7 +95,7 @@ public static function preRenderText($element) {
     $text = str_replace(["\r\n", "\r"], "\n", $text);
 
     // Get a complete list of filters, ordered properly.
-    /** @var \Drupal\filter\Plugin\FilterInterface[] $filters **/
+    /** @var \Drupal\filter\Plugin\FilterInterface[] $filters */
     $filters = $format->filters();
 
     // Give filters a chance to escape HTML-like data such as code or formulas.
diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index 51472cf8c5..66ba18b464 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -104,7 +104,7 @@ function forum_theme() {
  * Implements hook_entity_type_build().
  */
 function forum_entity_type_build(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   // Register forum specific forms.
   $entity_types['taxonomy_term']
     ->setFormClass('forum', 'Drupal\forum\Form\ForumForm')
diff --git a/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
index eb45247285..a92361e5ac 100644
--- a/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
+++ b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
@@ -60,7 +60,7 @@ public function normalize($entity, $format = NULL, array $context = []) {
     ];
 
     // Create the array of normalized fields, starting with the URI.
-    /** @var $entity \Drupal\Core\Entity\ContentEntityInterface */
+    /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
     $normalized = [
       '_links' => [
         'self' => [
diff --git a/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php b/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php
index fbcae8c758..a893f3489c 100644
--- a/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php
+++ b/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php
@@ -50,7 +50,7 @@ public function __construct(LinkManagerInterface $link_manager, EntityResolverIn
    * {@inheritdoc}
    */
   public function normalize($field_item, $format = NULL, array $context = []) {
-    /** @var $field_item \Drupal\Core\Field\FieldItemInterface */
+    /** @var \Drupal\Core\Field\FieldItemInterface $field_item */
     $target_entity = $field_item->get('entity')->getValue();
 
     // If this is not a content entity, let the parent implementation handle it,
diff --git a/core/modules/image/src/Tests/ImageDimensionsTest.php b/core/modules/image/src/Tests/ImageDimensionsTest.php
index b3e100dd9f..fe1f309803 100644
--- a/core/modules/image/src/Tests/ImageDimensionsTest.php
+++ b/core/modules/image/src/Tests/ImageDimensionsTest.php
@@ -32,7 +32,7 @@ public function testImageDimensions() {
     $original_uri = file_unmanaged_copy($file->uri, 'public://', FILE_EXISTS_RENAME);
 
     // Create a style.
-    /** @var $style \Drupal\image\ImageStyleInterface */
+    /** @var \Drupal\image\ImageStyleInterface $style */
     $style = ImageStyle::create(['name' => 'test', 'label' => 'Test']);
     $style->save();
     $generated_uri = 'public://styles/test/public/' . \Drupal::service('file_system')->basename($original_uri);
diff --git a/core/modules/link/src/Plugin/Validation/Constraint/LinkTypeConstraintValidator.php b/core/modules/link/src/Plugin/Validation/Constraint/LinkTypeConstraintValidator.php
index 817e934b0f..099ad774e0 100644
--- a/core/modules/link/src/Plugin/Validation/Constraint/LinkTypeConstraintValidator.php
+++ b/core/modules/link/src/Plugin/Validation/Constraint/LinkTypeConstraintValidator.php
@@ -18,7 +18,7 @@ public function validate($value, Constraint $constraint) {
     if (isset($value)) {
       $uri_is_valid = TRUE;
 
-      /** @var $link_item \Drupal\link\LinkItemInterface */
+      /** @var \Drupal\link\LinkItemInterface $link_item */
       $link_item = $value;
       $link_type = $link_item->getFieldDefinition()->getSetting('link_type');
 
diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module
index e46d97152a..da53aa0dd6 100644
--- a/core/modules/menu_ui/menu_ui.module
+++ b/core/modules/menu_ui/menu_ui.module
@@ -59,7 +59,7 @@ function menu_ui_help($route_name, RouteMatchInterface $route_match) {
  * Implements hook_entity_type_build().
  */
 function menu_ui_entity_type_build(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   $entity_types['menu']
     ->setFormClass('add', 'Drupal\menu_ui\MenuForm')
     ->setFormClass('edit', 'Drupal\menu_ui\MenuForm')
diff --git a/core/modules/migrate/src/MigrateExecutable.php b/core/modules/migrate/src/MigrateExecutable.php
index 8a593f27e0..3c1e02c394 100644
--- a/core/modules/migrate/src/MigrateExecutable.php
+++ b/core/modules/migrate/src/MigrateExecutable.php
@@ -348,7 +348,7 @@ public function rollback() {
   public function processRow(Row $row, array $process = NULL, $value = NULL) {
     foreach ($this->migration->getProcessPlugins($process) as $destination => $plugins) {
       $multiple = FALSE;
-      /** @var $plugin \Drupal\migrate\Plugin\MigrateProcessInterface */
+      /** @var \Drupal\migrate\Plugin\MigrateProcessInterface $plugin */
       foreach ($plugins as $plugin) {
         $definition = $plugin->getPluginDefinition();
         // Many plugins expect a scalar value but the current value of the
diff --git a/core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php b/core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php
index 180be0a3aa..25604e83fc 100644
--- a/core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php
+++ b/core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php
@@ -109,7 +109,7 @@ public function getDefinitions() {
               $finder = MockFileFinder::create($fileinfo->getPathName());
               $parser = new BaseStaticReflectionParser($class, $finder, FALSE);
 
-              /** @var $annotation \Drupal\Component\Annotation\AnnotationInterface */
+              /** @var \Drupal\Component\Annotation\AnnotationInterface $annotation */
               if ($annotation = $reader->getClassAnnotation($parser->getReflectionClass(), $this->pluginDefinitionAnnotationName)) {
                 $this->prepareAnnotationDefinition($annotation, $class, $parser);
 
diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php
index 552e3fb6ba..059637f199 100644
--- a/core/modules/node/src/NodeForm.php
+++ b/core/modules/node/src/NodeForm.php
@@ -75,7 +75,7 @@ public function form(array $form, FormStateInterface $form_state) {
     // rebuilding the form.
     $request_uuid = \Drupal::request()->query->get('uuid');
     if (!$form_state->isRebuilding() && $request_uuid && $preview = $store->get($request_uuid)) {
-      /** @var $preview \Drupal\Core\Form\FormStateInterface */
+      /** @var \Drupal\Core\Form\FormStateInterface $preview */
 
       $form_state->setStorage($preview->getStorage());
       $form_state->setUserInput($preview->getUserInput());
diff --git a/core/modules/node/src/Plugin/Search/NodeSearch.php b/core/modules/node/src/Plugin/Search/NodeSearch.php
index c200f34b61..785d811ab2 100644
--- a/core/modules/node/src/Plugin/Search/NodeSearch.php
+++ b/core/modules/node/src/Plugin/Search/NodeSearch.php
@@ -325,7 +325,7 @@ protected function prepareResults(StatementInterface $found) {
       $node = $node_storage->load($item->sid)->getTranslation($item->langcode);
       $build = $node_render->view($node, 'search_result', $item->langcode);
 
-      /** @var \Drupal\node\NodeTypeInterface $type*/
+      /** @var \Drupal\node\NodeTypeInterface $type */
       $type = $this->entityManager->getStorage('node_type')->load($node->bundle());
 
       unset($build['#theme']);
diff --git a/core/modules/node/tests/src/Functional/Update/NodeUpdateTest.php b/core/modules/node/tests/src/Functional/Update/NodeUpdateTest.php
index 223676b31e..ff69e19efa 100644
--- a/core/modules/node/tests/src/Functional/Update/NodeUpdateTest.php
+++ b/core/modules/node/tests/src/Functional/Update/NodeUpdateTest.php
@@ -53,10 +53,8 @@ public function testStatusCheckbox() {
     $ids = $query->execute();
     $form_displays = EntityFormDisplay::loadMultiple($ids);
 
-    /**
-     * @var string $id
-     * @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display
-     */
+    /** @var string $id */
+    /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display */
     foreach ($form_displays as $id => $form_display) {
       $component = $form_display->getComponent('status');
       $this->assertEqual('boolean_checkbox', $component['type']);
diff --git a/core/modules/node/tests/src/Functional/Views/NodeFieldTokensTest.php b/core/modules/node/tests/src/Functional/Views/NodeFieldTokensTest.php
index fc547ed370..0ca3b3c69e 100644
--- a/core/modules/node/tests/src/Functional/Views/NodeFieldTokensTest.php
+++ b/core/modules/node/tests/src/Functional/Views/NodeFieldTokensTest.php
@@ -35,7 +35,7 @@ public function testViewsTokenReplacement() {
     $body = $this->randomMachineName(32);
     $summary = $this->randomMachineName(16);
 
-    /** @var $node \Drupal\node\NodeInterface */
+    /** @var \Drupal\node\NodeInterface $node */
     $node = Node::create([
       'type' => 'article',
       'tnid' => 0,
diff --git a/core/modules/quickedit/quickedit.module b/core/modules/quickedit/quickedit.module
index d569de2503..421509153d 100644
--- a/core/modules/quickedit/quickedit.module
+++ b/core/modules/quickedit/quickedit.module
@@ -134,7 +134,7 @@ function quickedit_preprocess_field(&$variables) {
   }
 
   $element = $variables['element'];
-  /** @var $entity \Drupal\Core\Entity\EntityInterface */
+  /** @var \Drupal\Core\Entity\EntityInterface $entity */
   $entity = $element['#object'];
 
   // Quick Edit module only supports view modes, not dynamically defined
diff --git a/core/modules/quickedit/src/Form/QuickEditFieldForm.php b/core/modules/quickedit/src/Form/QuickEditFieldForm.php
index ba2dac38eb..ccfa7859d6 100644
--- a/core/modules/quickedit/src/Form/QuickEditFieldForm.php
+++ b/core/modules/quickedit/src/Form/QuickEditFieldForm.php
@@ -174,7 +174,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
    * it back to the form state and save it.
    */
   protected function buildEntity(array $form, FormStateInterface $form_state) {
-    /** @var $entity \Drupal\Core\Entity\EntityInterface */
+    /** @var \Drupal\Core\Entity\EntityInterface $entity */
     $entity = clone $form_state->get('entity');
     $field_name = $form_state->get('field_name');
 
diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module
index 8d4329884d..7866680204 100644
--- a/core/modules/rdf/rdf.module
+++ b/core/modules/rdf/rdf.module
@@ -233,7 +233,7 @@ function rdf_comment_storage_load($comments) {
     // to optimize performance for websites that implement an entity cache.
     $created_mapping = rdf_get_mapping('comment', $comment->bundle())
       ->getPreparedFieldMapping('created');
-    /** @var \Drupal\comment\CommentInterface $comment*/
+    /** @var \Drupal\comment\CommentInterface $comment */
     $comment->rdf_data['date'] = rdf_rdfa_attributes($created_mapping, $comment->get('created')->first()->toArray());
     $entity = $comment->getCommentedEntity();
     // The current function is a storage level hook, so avoid to bubble
@@ -358,7 +358,7 @@ function rdf_preprocess_node(&$variables) {
  * Implements hook_preprocess_HOOK() for user templates.
  */
 function rdf_preprocess_user(&$variables) {
-  /** @var $account \Drupal\user\UserInterface */
+  /** @var \Drupal\user\UserInterface $account */
   $account = $variables['elements']['#user'];
   $uri = $account->urlInfo();
   $mapping = rdf_get_mapping('user', 'user');
diff --git a/core/modules/search/search.module b/core/modules/search/search.module
index ae99a8731e..914614e8b6 100644
--- a/core/modules/search/search.module
+++ b/core/modules/search/search.module
@@ -190,7 +190,7 @@ function search_cron() {
   // to date.
   drupal_register_shutdown_function('search_update_totals');
 
-  /** @var $search_page_repository \Drupal\search\SearchPageRepositoryInterface */
+  /** @var \Drupal\search\SearchPageRepositoryInterface $search_page_repository */
   $search_page_repository = \Drupal::service('search.search_page_repository');
   foreach ($search_page_repository->getIndexableSearchPages() as $entity) {
     $entity->getPlugin()->updateIndex();
diff --git a/core/modules/search/src/Entity/SearchPage.php b/core/modules/search/src/Entity/SearchPage.php
index 85ddc26082..ba9a0fa280 100644
--- a/core/modules/search/src/Entity/SearchPage.php
+++ b/core/modules/search/src/Entity/SearchPage.php
@@ -204,8 +204,8 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti
    * {@inheritdoc}
    */
   public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) {
-    /** @var $a \Drupal\search\SearchPageInterface */
-    /** @var $b \Drupal\search\SearchPageInterface */
+    /** @var \Drupal\search\SearchPageInterface $a */
+    /** @var \Drupal\search\SearchPageInterface $b */
     $a_status = (int) $a->status();
     $b_status = (int) $b->status();
     if ($a_status != $b_status) {
diff --git a/core/modules/search/src/SearchPageAccessControlHandler.php b/core/modules/search/src/SearchPageAccessControlHandler.php
index 2627f51e0e..0fd93dac2a 100644
--- a/core/modules/search/src/SearchPageAccessControlHandler.php
+++ b/core/modules/search/src/SearchPageAccessControlHandler.php
@@ -19,7 +19,7 @@ class SearchPageAccessControlHandler extends EntityAccessControlHandler {
    * {@inheritdoc}
    */
   protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
-    /** @var $entity \Drupal\search\SearchPageInterface */
+    /** @var \Drupal\search\SearchPageInterface $entity */
     if (in_array($operation, ['delete', 'disable'])) {
       if ($entity->isDefaultSearch()) {
         return AccessResult::forbidden()->addCacheableDependency($entity);
diff --git a/core/modules/search/src/SearchPageListBuilder.php b/core/modules/search/src/SearchPageListBuilder.php
index 9a8f6deb30..06c73062a4 100644
--- a/core/modules/search/src/SearchPageListBuilder.php
+++ b/core/modules/search/src/SearchPageListBuilder.php
@@ -115,7 +115,7 @@ public function buildHeader() {
    * {@inheritdoc}
    */
   public function buildRow(EntityInterface $entity) {
-    /** @var $entity \Drupal\search\SearchPageInterface */
+    /** @var \Drupal\search\SearchPageInterface $entity */
     $row['label'] = $entity->label();
     $row['url']['#markup'] = 'search/' . $entity->getPath();
     // If the search page is active, link to it.
@@ -294,7 +294,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    * {@inheritdoc}
    */
   public function getDefaultOperations(EntityInterface $entity) {
-    /** @var $entity \Drupal\search\SearchPageInterface */
+    /** @var \Drupal\search\SearchPageInterface $entity */
     $operations = parent::getDefaultOperations($entity);
 
     // Prevent the default search from being disabled or deleted.
diff --git a/core/modules/search/src/Tests/SearchBlockTest.php b/core/modules/search/src/Tests/SearchBlockTest.php
index 21afda7f05..ad60cd8bdf 100644
--- a/core/modules/search/src/Tests/SearchBlockTest.php
+++ b/core/modules/search/src/Tests/SearchBlockTest.php
@@ -67,7 +67,7 @@ public function testSearchFormBlock() {
     $this->assertText('Your search yielded no results');
 
     // Confirm that the form submits to the default search page.
-    /** @var $search_page_repository \Drupal\search\SearchPageRepositoryInterface */
+    /** @var \Drupal\search\SearchPageRepositoryInterface $search_page_repository */
     $search_page_repository = \Drupal::service('search.search_page_repository');
     $entity_id = $search_page_repository->getDefaultSearchPage();
     $this->assertEqual(
diff --git a/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php
index cc77f2b6a6..7c5d5a0114 100644
--- a/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php
+++ b/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php
@@ -145,7 +145,7 @@ public function testSearchModuleDisabling() {
       ],
     ];
     $plugins = array_keys($plugin_info);
-    /** @var $entities \Drupal\search\SearchPageInterface[] */
+    /** @var \Drupal\search\SearchPageInterface[] $entities */
     $entities = SearchPage::loadMultiple();
     // Disable all of the search pages.
     foreach ($entities as $entity) {
@@ -383,7 +383,7 @@ protected function verifySearchPageOperations($id, $edit, $delete, $disable, $en
    *   (optional) The group this message is in.
    */
   protected function assertDefaultSearch($expected, $message = '', $group = 'Other') {
-    /** @var $search_page_repository \Drupal\search\SearchPageRepositoryInterface */
+    /** @var \Drupal\search\SearchPageRepositoryInterface $search_page_repository */
     $search_page_repository = \Drupal::service('search.search_page_repository');
     $this->assertIdentical($search_page_repository->getDefaultSearchPage(), $expected, $message, $group);
   }
diff --git a/core/modules/system/src/SystemManager.php b/core/modules/system/src/SystemManager.php
index d2e03443db..907a6971b0 100644
--- a/core/modules/system/src/SystemManager.php
+++ b/core/modules/system/src/SystemManager.php
@@ -202,7 +202,7 @@ public function getAdminBlock(MenuLinkInterface $instance) {
         continue;
       }
 
-      /** @var $link \Drupal\Core\Menu\MenuLinkInterface */
+      /** @var \Drupal\Core\Menu\MenuLinkInterface $link */
       $link = $element->link;
       $content[$key]['title'] = $link->getTitle();
       $content[$key]['options'] = $link->getOptions();
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index bde03467a7..74928c7f51 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -1465,7 +1465,7 @@ function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $repl
  * Implements hook_entity_type_build().
  */
 function system_entity_type_build(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   $entity_types['date_format']
     ->setFormClass('add', 'Drupal\system\Form\DateFormatAddForm')
     ->setFormClass('edit', 'Drupal\system\Form\DateFormatEditForm')
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 bcf55f48b2..2f51d6f56d 100644
--- a/core/modules/system/tests/modules/entity_test/entity_test.module
+++ b/core/modules/system/tests/modules/entity_test/entity_test.module
@@ -84,7 +84,7 @@ function entity_test_entity_types($filter = NULL) {
 function entity_test_entity_type_alter(array &$entity_types) {
   $state = \Drupal::state();
 
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   foreach (entity_test_entity_types() as $entity_type) {
     // Optionally specify a translation handler for testing translations.
     if ($state->get('entity_test.translation')) {
diff --git a/core/modules/system/tests/modules/keyvalue_test/keyvalue_test.module b/core/modules/system/tests/modules/keyvalue_test/keyvalue_test.module
index 4316719dd3..5c47ab28f4 100644
--- a/core/modules/system/tests/modules/keyvalue_test/keyvalue_test.module
+++ b/core/modules/system/tests/modules/keyvalue_test/keyvalue_test.module
@@ -9,7 +9,7 @@
  * Implements hook_entity_type_alter().
  */
 function keyvalue_test_entity_type_alter(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   if (isset($entity_types['entity_test_label'])) {
     $entity_types['entity_test_label']->setStorageClass('Drupal\Core\Entity\KeyValueStore\KeyValueContentEntityStorage');
     $entity_keys = $entity_types['entity_test_label']->getKeys();
diff --git a/core/modules/system/tests/src/Functional/Entity/ConfigEntityImportTest.php b/core/modules/system/tests/src/Functional/Entity/ConfigEntityImportTest.php
index 6c5a9d64c5..dc266ccc23 100644
--- a/core/modules/system/tests/src/Functional/Entity/ConfigEntityImportTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/ConfigEntityImportTest.php
@@ -89,7 +89,7 @@ protected function doFilterFormatUpdate() {
     // Create a test filter format with a known label.
     $name = 'filter.format.plain_text';
 
-    /** @var $entity \Drupal\filter\Entity\FilterFormat */
+    /** @var \Drupal\filter\Entity\FilterFormat $entity */
     $entity = FilterFormat::load('plain_text');
     $plugin_collection = $entity->getPluginCollections()['filters'];
 
@@ -121,7 +121,7 @@ protected function doImageStyleUpdate() {
     // Create a test image style with a known label.
     $name = 'image.style.thumbnail';
 
-    /** @var $entity \Drupal\image\Entity\ImageStyle */
+    /** @var \Drupal\image\Entity\ImageStyle $entity */
     $entity = ImageStyle::load('thumbnail');
     $plugin_collection = $entity->getPluginCollections()['effects'];
 
diff --git a/core/modules/taxonomy/src/Form/OverviewTerms.php b/core/modules/taxonomy/src/Form/OverviewTerms.php
index 3811ee5fd8..0d22586f50 100644
--- a/core/modules/taxonomy/src/Form/OverviewTerms.php
+++ b/core/modules/taxonomy/src/Form/OverviewTerms.php
@@ -216,7 +216,7 @@ public function buildForm(array $form, FormStateInterface $form_state, Vocabular
       ],
     ];
     foreach ($current_page as $key => $term) {
-      /** @var $term \Drupal\Core\Entity\EntityInterface */
+      /** @var \Drupal\Core\Entity\EntityInterface $term */
       $term = $this->entityManager->getTranslationFromContext($term);
       $form['terms'][$key]['#term'] = $term;
       $indentation = [];
@@ -469,7 +469,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
    * Redirects to confirmation form for the reset action.
    */
   public function submitReset(array &$form, FormStateInterface $form_state) {
-    /** @var $vocabulary \Drupal\taxonomy\VocabularyInterface */
+    /** @var \Drupal\taxonomy\VocabularyInterface $vocabulary */
     $vocabulary = $form_state->get(['taxonomy', 'vocabulary']);
     $form_state->setRedirectUrl($vocabulary->urlInfo('reset-form'));
   }
diff --git a/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php b/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
index 832e5111bf..b348de3010 100644
--- a/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
@@ -99,17 +99,16 @@ public function testTaxonomyVocabularyTree() {
     $term[5]->parent = [$term[4]->id()];
     $term[5]->save();
 
-    /**
-     * Expected tree:
-     * term[0] | depth: 0
-     * term[1] | depth: 0
-     * -- term[2] | depth: 1
-     * ---- term[3] | depth: 2
-     * term[4] | depth: 0
-     * -- term[5] | depth: 1
-     * ---- term[2] | depth: 2
-     * ------ term[3] | depth: 3
-     */
+    // Expected tree:
+    // term[0] | depth: 0
+    // term[1] | depth: 0
+    // -- term[2] | depth: 1
+    // ---- term[3] | depth: 2
+    // term[4] | depth: 0
+    // -- term[5] | depth: 1
+    // ---- term[2] | depth: 2
+    // ------ term[3] | depth: 3
+    //
     // Count $term[1] parents with $max_depth = 1.
     $tree = $taxonomy_storage->loadTree($vocabulary->id(), $term[1]->id(), 1);
     $this->assertEqual(1, count($tree), 'We have one parent with depth 1.');
diff --git a/core/modules/user/src/Plugin/Field/FieldFormatter/AuthorFormatter.php b/core/modules/user/src/Plugin/Field/FieldFormatter/AuthorFormatter.php
index 9f74d67d09..1ba04bdc6b 100644
--- a/core/modules/user/src/Plugin/Field/FieldFormatter/AuthorFormatter.php
+++ b/core/modules/user/src/Plugin/Field/FieldFormatter/AuthorFormatter.php
@@ -28,7 +28,7 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
     $elements = [];
 
     foreach ($this->getEntitiesToView($items, $langcode) as $delta => $entity) {
-      /** @var $referenced_user \Drupal\user\UserInterface */
+      /** @var \Drupal\user\UserInterface $referenced_user */
       $elements[$delta] = [
         '#theme' => 'username',
         '#account' => $entity,
diff --git a/core/modules/user/src/Plugin/Field/FieldFormatter/UserNameFormatter.php b/core/modules/user/src/Plugin/Field/FieldFormatter/UserNameFormatter.php
index 30756162e1..e966423ad6 100644
--- a/core/modules/user/src/Plugin/Field/FieldFormatter/UserNameFormatter.php
+++ b/core/modules/user/src/Plugin/Field/FieldFormatter/UserNameFormatter.php
@@ -53,7 +53,7 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
     $elements = [];
 
     foreach ($items as $delta => $item) {
-      /** @var $user \Drupal\user\UserInterface */
+      /** @var \Drupal\user\UserInterface $user */
       if ($user = $item->getEntity()) {
         if ($this->getSetting('link_to_entity')) {
           $elements[$delta] = [
diff --git a/core/modules/user/src/UserAccessControlHandler.php b/core/modules/user/src/UserAccessControlHandler.php
index 712b32ab51..a7c260f812 100644
--- a/core/modules/user/src/UserAccessControlHandler.php
+++ b/core/modules/user/src/UserAccessControlHandler.php
@@ -28,7 +28,7 @@ class UserAccessControlHandler extends EntityAccessControlHandler {
    * {@inheritdoc}
    */
   protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
-    /** @var \Drupal\user\UserInterface $entity*/
+    /** @var \Drupal\user\UserInterface $entity */
 
     // We don't treat the user label as privileged information, so this check
     // has to be the first one in order to allow labels for all users to be
diff --git a/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php b/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php
index 075b04c5e0..a859c98a45 100644
--- a/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php
+++ b/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php
@@ -105,7 +105,7 @@ protected function setUp() {
   public function testConditions() {
     // Grab the user role condition and configure it to check against
     // authenticated user roles.
-    /** @var $condition \Drupal\Core\Condition\ConditionInterface */
+    /** @var \Drupal\Core\Condition\ConditionInterface $condition */
     $condition = $this->manager->createInstance('user_role')
       ->setConfig('roles', [RoleInterface::AUTHENTICATED_ID => RoleInterface::AUTHENTICATED_ID])
       ->setContextValue('user', $this->anonymous);
diff --git a/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php b/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php
index bc6400c018..b6fadb32df 100644
--- a/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php
+++ b/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php
@@ -71,7 +71,7 @@ public function getDerivativeDefinitions($base_plugin_definition) {
 
     $view_route_names = $this->state->get('views.view_route_names');
     foreach ($this->getApplicableMenuViews() as $pair) {
-      /** @var $executable \Drupal\views\ViewExecutable */
+      /** @var \Drupal\views\ViewExecutable $executable */
       list($view_id, $display_id) = $pair;
       $executable = $this->viewStorage->load($view_id)->getExecutable();
 
@@ -110,7 +110,7 @@ public function alterLocalTasks(&$local_tasks) {
 
     foreach ($this->getApplicableMenuViews() as $pair) {
       list($view_id, $display_id) = $pair;
-      /** @var $executable \Drupal\views\ViewExecutable */
+      /** @var \Drupal\views\ViewExecutable $executable */
       $executable = $this->viewStorage->load($view_id)->getExecutable();
 
       $executable->setDisplay($display_id);
diff --git a/core/modules/views/src/Plugin/views/field/EntityLabel.php b/core/modules/views/src/Plugin/views/field/EntityLabel.php
index 86ccd05449..1fcf0c6dc5 100644
--- a/core/modules/views/src/Plugin/views/field/EntityLabel.php
+++ b/core/modules/views/src/Plugin/views/field/EntityLabel.php
@@ -103,7 +103,7 @@ public function render(ResultRow $values) {
       return;
     }
 
-    /** @var $entity \Drupal\Core\Entity\EntityInterface */
+    /** @var \Drupal\Core\Entity\EntityInterface $entity */
     $entity = $this->loadedReferencers[$type][$value];
 
     if (!empty($this->options['link_to_entity'])) {
diff --git a/core/modules/views/src/Plugin/views/query/Sql.php b/core/modules/views/src/Plugin/views/query/Sql.php
index ab056f59a7..e5ac34971c 100644
--- a/core/modules/views/src/Plugin/views/query/Sql.php
+++ b/core/modules/views/src/Plugin/views/query/Sql.php
@@ -1209,10 +1209,8 @@ public function query($get_count = FALSE) {
       $distinct = TRUE;
     }
 
-    /**
-     * An optimized count query includes just the base field instead of all the fields.
-     * Determine of this query qualifies by checking for a groupby or distinct.
-     */
+    // An optimized count query includes just the base field instead of all the fields.
+    // Determine of this query qualifies by checking for a groupby or distinct.
     if ($get_count && !$this->groupby) {
       foreach ($this->fields as $field) {
         if (!empty($field['distinct']) || !empty($field['function'])) {
diff --git a/core/modules/views/tests/src/Functional/Handler/FieldEntityOperationsTest.php b/core/modules/views/tests/src/Functional/Handler/FieldEntityOperationsTest.php
index 7ced4f7071..5237f0b34e 100644
--- a/core/modules/views/tests/src/Functional/Handler/FieldEntityOperationsTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/FieldEntityOperationsTest.php
@@ -64,7 +64,7 @@ public function testEntityOperations() {
     $admin_user = $this->drupalCreateUser(['access administration pages', 'administer nodes', 'bypass node access']);
     $this->drupalLogin($this->rootUser);
     $this->drupalGet('test-entity-operations');
-    /** @var $entity \Drupal\entity_test\Entity\EntityTest */
+    /** @var \Drupal\entity_test\Entity\EntityTest $entity */
     foreach ($entities as $entity) {
       /** @var \Drupal\Core\Language\LanguageInterface $language */
       foreach ($entity->getTranslationLanguages() as $language) {
diff --git a/core/modules/views_ui/src/Form/Ajax/Analyze.php b/core/modules/views_ui/src/Form/Ajax/Analyze.php
index 52784d3d3c..1622191b58 100644
--- a/core/modules/views_ui/src/Form/Ajax/Analyze.php
+++ b/core/modules/views_ui/src/Form/Ajax/Analyze.php
@@ -52,7 +52,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    * {@inheritdoc}
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
-    /** @var $view \Drupal\views_ui\ViewUI */
+    /** @var \Drupal\views_ui\ViewUI $view */
     $view = $form_state->get('view');
     $form_state->setRedirectUrl($view->urlInfo('edit-form'));
   }
diff --git a/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php b/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php
index 3298681051..dfe8d956cf 100644
--- a/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php
+++ b/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php
@@ -75,16 +75,13 @@ public function buildForm(array $form, FormStateInterface $form_state) {
 
     $group_options = [];
 
-    /**
-     * Filter groups is an array that contains:
-     * array(
-     *   'operator' => 'and' || 'or',
-     *   'groups' => array(
-     *     $group_id => 'and' || 'or',
-     *   ),
-     * );
-     */
-
+    // Filter groups is an array that contains:
+    // array(
+    //   'operator' => 'and' || 'or',
+    //   'groups' => array(
+    //     $group_id => 'and' || 'or',
+    //   ),
+    // );
     $grouping = count(array_keys($groups['groups'])) > 1;
 
     $form['filter_groups']['#tree'] = TRUE;
diff --git a/core/modules/views_ui/src/Form/Ajax/ReorderDisplays.php b/core/modules/views_ui/src/Form/Ajax/ReorderDisplays.php
index 377a3d55c2..cecc1de0af 100644
--- a/core/modules/views_ui/src/Form/Ajax/ReorderDisplays.php
+++ b/core/modules/views_ui/src/Form/Ajax/ReorderDisplays.php
@@ -29,7 +29,7 @@ public function getFormId() {
    * {@inheritdoc}
    */
   public function buildForm(array $form, FormStateInterface $form_state) {
-    /** @var $view \Drupal\views\ViewEntityInterface */
+    /** @var \Drupal\views\ViewEntityInterface $view */
     $view = $form_state->get('view');
     $display_id = $form_state->get('display_id');
 
@@ -147,7 +147,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    * {@inheritdoc}
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
-    /** @var $view \Drupal\views_ui\ViewUI */
+    /** @var \Drupal\views_ui\ViewUI $view */
     $view = $form_state->get('view');
     $order = [];
 
diff --git a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
index 375766a4c3..e3c8706ec2 100644
--- a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
+++ b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
@@ -134,7 +134,7 @@ public function getForm(ViewEntityInterface $view, $display_id, $js) {
 
       // Build the new form state for the next form in the stack.
       $reflection = new \ReflectionClass($view::$forms[$top[1]]);
-      /** @var $form_state \Drupal\Core\Form\FormStateInterface */
+      /** @var \Drupal\Core\Form\FormStateInterface $form_state */
       $form_state = $reflection->newInstanceArgs(array_slice($top, 3, 2))->getFormState($view, $top[2], $form_state->get('ajax'));
       $form_class = get_class($form_state->getFormObject());
 
diff --git a/core/modules/views_ui/src/ViewAddForm.php b/core/modules/views_ui/src/ViewAddForm.php
index 429032c845..ed52d8f4a6 100644
--- a/core/modules/views_ui/src/ViewAddForm.php
+++ b/core/modules/views_ui/src/ViewAddForm.php
@@ -176,7 +176,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
     try {
-      /** @var $wizard \Drupal\views\Plugin\views\wizard\WizardInterface */
+      /** @var \Drupal\views\Plugin\views\wizard\WizardInterface $wizard */
       $wizard = $form_state->get('wizard_instance');
       $this->entity = $wizard->createView($form, $form_state);
     }
diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module
index 15f85e3a02..8d1ef6e13a 100644
--- a/core/modules/views_ui/views_ui.module
+++ b/core/modules/views_ui/views_ui.module
@@ -37,7 +37,7 @@ function views_ui_help($route_name, RouteMatchInterface $route_match) {
  * Implements hook_entity_type_build().
  */
 function views_ui_entity_type_build(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
   $entity_types['view']
     ->setFormClass('edit', 'Drupal\views_ui\ViewEditForm')
     ->setFormClass('add', 'Drupal\views_ui\ViewAddForm')
diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist
index 612012b9b7..e346f3cde9 100644
--- a/core/phpcs.xml.dist
+++ b/core/phpcs.xml.dist
@@ -63,6 +63,15 @@
     <exclude name="Drupal.Commenting.FunctionComment.ParamMissingDefinition"/>
     <exclude name="Drupal.Commenting.FunctionComment.TypeHintMissing"/>
   </rule>
+  <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php">
+    <!-- Sniff for: DocBlock -->
+    <exclude name="Drupal.Commenting.InlineComment.InvalidEndChar"/>
+    <exclude name="Drupal.Commenting.InlineComment.NoSpaceBefore"/>
+    <exclude name="Drupal.Commenting.InlineComment.NotCapital"/>
+    <exclude name="Drupal.Commenting.InlineComment.SpacingAfter"/>
+    <exclude name="Drupal.Commenting.InlineComment.SpacingBefore"/>
+    <exclude name="Drupal.Commenting.InlineComment.WrongStyle"/>
+  </rule>
   <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/ControlStructures/ElseIfSniff.php"/>
   <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/ControlStructures/ControlSignatureSniff.php"/>
   <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Files/EndFileNewlineSniff.php"/>
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/CurrentThemeConditionTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/CurrentThemeConditionTest.php
index 7a69d2eb04..c3542e8b8e 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/CurrentThemeConditionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/CurrentThemeConditionTest.php
@@ -24,10 +24,10 @@ public function testCurrentTheme() {
     \Drupal::service('theme_handler')->install(['test_theme']);
 
     $manager = \Drupal::service('plugin.manager.condition');
-    /** @var $condition \Drupal\Core\Condition\ConditionInterface */
+    /** @var \Drupal\Core\Condition\ConditionInterface $condition */
     $condition = $manager->createInstance('current_theme');
     $condition->setConfiguration(['theme' => 'test_theme']);
-    /** @var $condition_negated \Drupal\Core\Condition\ConditionInterface */
+    /** @var \Drupal\Core\Condition\ConditionInterface $condition_negated */
     $condition_negated = $manager->createInstance('current_theme');
     $condition_negated->setConfiguration(['theme' => 'test_theme', 'negate' => TRUE]);
 
diff --git a/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php b/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php
index 8927597452..363b76442d 100644
--- a/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php
+++ b/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php
@@ -63,7 +63,7 @@ public function providerTestEquals() {
     // Tests field item lists with no values.
     $datasets[] = [TRUE];
 
-    /** @var \Drupal\Core\Field\FieldItemBase  $field_item_a */
+    /** @var \Drupal\Core\Field\FieldItemBase $field_item_a */
     $field_item_a = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
     $field_item_a->setValue([1]);
     // Tests field item lists where one has a value and one does not.
@@ -72,13 +72,13 @@ public function providerTestEquals() {
     // Tests field item lists where both have the same value.
     $datasets[] = [TRUE, $field_item_a, $field_item_a];
 
-    /** @var \Drupal\Core\Field\FieldItemBase  $fv */
+    /** @var \Drupal\Core\Field\FieldItemBase $fv */
     $field_item_b = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
     $field_item_b->setValue([2]);
     // Tests field item lists where both have the different values.
     $datasets[] = [FALSE, $field_item_a, $field_item_b];
 
-    /** @var \Drupal\Core\Field\FieldItemBase  $fv */
+    /** @var \Drupal\Core\Field\FieldItemBase $fv */
     $field_item_c = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
     $field_item_c->setValue(['0' => 1, '1' => 2]);
     $field_item_d = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
@@ -87,7 +87,7 @@ public function providerTestEquals() {
     // Tests field item lists where both have the differently ordered values.
     $datasets[] = [TRUE, $field_item_c, $field_item_d];
 
-    /** @var \Drupal\Core\Field\FieldItemBase  $field_item_e */
+    /** @var \Drupal\Core\Field\FieldItemBase $field_item_e */
     $field_item_e = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
     $field_item_e->setValue(['2']);
 
@@ -102,7 +102,7 @@ public function providerTestEquals() {
    * @covers ::equals
    */
   public function testEqualsEmptyItems() {
-    /** @var \Drupal\Core\Field\FieldItemBase  $fv */
+    /** @var \Drupal\Core\Field\FieldItemBase $fv */
     $first_field_item = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
     $first_field_item->setValue(['0' => 1, '1' => 2]);
     $second_field_item = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
