Unverified Commit 4a72cc31 authored by alexpott's avatar alexpott
Browse files

Issue #3207734 by Spokje, quietone: Fix Drupal.Commenting.InlineVariableComment

parent 3f75f72d
......@@ -1784,7 +1784,7 @@ function template_preprocess_pager(&$variables) {
$route_name = $variables['pager']['#route_name'];
$route_parameters = isset($variables['pager']['#route_parameters']) ? $variables['pager']['#route_parameters'] : [];
/* @var $pager_manager \Drupal\Core\Pager\PagerManagerInterface */
/** @var \Drupal\Core\Pager\PagerManagerInterface $pager_manager */
$pager_manager = \Drupal::service('pager.manager');
$pager = $pager_manager->getPager($element);
......
......@@ -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);
......
......@@ -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();
}
}
......
......@@ -1233,7 +1233,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') ||
......
......@@ -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();
}
......
......@@ -211,7 +211,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
return !$field_definition->isComputed();
});
foreach ($bundle_fields as $field_name => $field_definition) {
/* @var \Drupal\Core\Field\FieldDefinitionInterface $field_definition */
/** @var \Drupal\Core\Field\FieldDefinitionInterface $field_definition */
$columns = $field_definition->getFieldStorageDefinition()->getColumns();
// If there is more than one column, display them all, otherwise just
// display the field label.
......
......@@ -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]);
}
......
......@@ -14,7 +14,7 @@ class ReferenceAccessConstraintValidator extends ConstraintValidator {
* {@inheritdoc}
*/
public function validate($value, Constraint $constraint) {
/* @var \Drupal\Core\Field\FieldItemInterface $value */
/** @var \Drupal\Core\Field\FieldItemInterface $value */
if (!isset($value)) {
return;
}
......@@ -23,7 +23,7 @@ public function validate($value, Constraint $constraint) {
if (empty($id)) {
return;
}
/* @var \Drupal\Core\Entity\FieldableEntityInterface $referenced_entity */
/** @var \Drupal\Core\Entity\FieldableEntityInterface $referenced_entity */
$referenced_entity = $value->entity;
if ($referenced_entity) {
$entity = $value->getEntity();
......
......@@ -785,7 +785,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');
......@@ -814,7 +814,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');
......
......@@ -234,7 +234,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']);
......
......@@ -37,7 +37,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.
......
......@@ -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();
......
......@@ -178,7 +178,7 @@ public function getActionsForRoute($route_appears) {
$links = [];
$cacheability = new CacheableMetadata();
$cacheability->addCacheContexts(['route']);
/** @var $plugin \Drupal\Core\Menu\LocalActionInterface */
/** @var \Drupal\Core\Menu\LocalActionInterface $plugin */
foreach ($this->instances[$route_appears] as $plugin_id => $plugin) {
$route_name = $plugin->getRouteName();
$route_parameters = $plugin->getRouteParameters($this->routeMatch);
......
......@@ -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);
......
......@@ -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.
......
......@@ -81,7 +81,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.
......
......@@ -207,7 +207,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());
}
......@@ -223,7 +223,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());
}
......@@ -240,7 +240,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());
}
......
......@@ -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
......
......@@ -113,7 +113,7 @@ public function cleanDatabase() {
* The number of tables that were removed.
*/
protected function doCleanDatabase() {
/* @var $schema \Drupal\Core\Database\Schema */
/** @var \Drupal\Core\Database\Schema $schema */
$schema = $this->testDatabase->schema();
$tables = $schema->findTables('test%');
$count = 0;
......
......@@ -42,7 +42,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', ActionAddForm::class)
->setFormClass('edit', ActionEditForm::class)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment