Unverified Commit 203ad064 authored by alexpott's avatar alexpott

Issue #2723621 by jofitz, mfernea, alexpott, abhisekmazumdar, neclimdul,...

Issue #2723621 by jofitz, mfernea, alexpott, abhisekmazumdar, neclimdul, snehi, Suresh Prabhu Parkala, ankithashetty, anmolgoyal74, anoopjohn, longwave, hgunicamp, empesan, kostyashupenko, Mile23, dawehner, idebr, daffie, catch: Fix Drupal.Commenting.FunctionComment.IncorrectTypeHint and Drupal.Commenting.FunctionComment.InvalidTypeHint
parent 64e0464a
......@@ -956,7 +956,7 @@ function hook_ENTITY_TYPE_create(\Drupal\Core\Entity\EntityInterface $entity) {
* @see \Drupal\Core\Entity\RevisionableStorageInterface::createRevision()
* @see \Drupal\Core\Entity\TranslatableRevisionableStorageInterface::createRevision()
*/
function hook_entity_revision_create(Drupal\Core\Entity\EntityInterface $new_revision, Drupal\Core\Entity\EntityInterface $entity, $keep_untranslatable_fields) {
function hook_entity_revision_create(\Drupal\Core\Entity\EntityInterface $new_revision, \Drupal\Core\Entity\EntityInterface $entity, $keep_untranslatable_fields) {
// Retain the value from an untranslatable field, which are by default
// synchronized from the default revision.
$new_revision->set('untranslatable_field', $entity->get('untranslatable_field'));
......@@ -980,7 +980,7 @@ function hook_entity_revision_create(Drupal\Core\Entity\EntityInterface $new_rev
* @see \Drupal\Core\Entity\RevisionableStorageInterface::createRevision()
* @see \Drupal\Core\Entity\TranslatableRevisionableStorageInterface::createRevision()
*/
function hook_ENTITY_TYPE_revision_create(Drupal\Core\Entity\EntityInterface $new_revision, Drupal\Core\Entity\EntityInterface $entity, $keep_untranslatable_fields) {
function hook_ENTITY_TYPE_revision_create(\Drupal\Core\Entity\EntityInterface $new_revision, \Drupal\Core\Entity\EntityInterface $entity, $keep_untranslatable_fields) {
// Retain the value from an untranslatable field, which are by default
// synchronized from the default revision.
$new_revision->set('untranslatable_field', $entity->get('untranslatable_field'));
......@@ -1096,7 +1096,7 @@ function hook_ENTITY_TYPE_storage_load(array $entities) {
* @ingroup entity_crud
* @see hook_ENTITY_TYPE_presave()
*/
function hook_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
function hook_entity_presave(\Drupal\Core\Entity\EntityInterface $entity) {
if ($entity instanceof ContentEntityInterface && $entity->isTranslatable()) {
$route_match = \Drupal::routeMatch();
\Drupal::service('content_translation.synchronizer')->synchronizeFields($entity, $entity->language()->getId(), $route_match->getParameter('source_langcode'));
......@@ -1115,7 +1115,7 @@ function hook_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
* @ingroup entity_crud
* @see hook_entity_presave()
*/
function hook_ENTITY_TYPE_presave(Drupal\Core\Entity\EntityInterface $entity) {
function hook_ENTITY_TYPE_presave(\Drupal\Core\Entity\EntityInterface $entity) {
if ($entity->isTranslatable()) {
$route_match = \Drupal::routeMatch();
\Drupal::service('content_translation.synchronizer')->synchronizeFields($entity, $entity->language()->getId(), $route_match->getParameter('source_langcode'));
......@@ -1134,7 +1134,7 @@ function hook_ENTITY_TYPE_presave(Drupal\Core\Entity\EntityInterface $entity) {
* @ingroup entity_crud
* @see hook_ENTITY_TYPE_insert()
*/
function hook_entity_insert(Drupal\Core\Entity\EntityInterface $entity) {
function hook_entity_insert(\Drupal\Core\Entity\EntityInterface $entity) {
// Insert the new entity into a fictional table of all entities.
\Drupal::database()->insert('example_entity')
->fields([
......@@ -1158,7 +1158,7 @@ function hook_entity_insert(Drupal\Core\Entity\EntityInterface $entity) {
* @ingroup entity_crud
* @see hook_entity_insert()
*/
function hook_ENTITY_TYPE_insert(Drupal\Core\Entity\EntityInterface $entity) {
function hook_ENTITY_TYPE_insert(\Drupal\Core\Entity\EntityInterface $entity) {
// Insert the new entity into a fictional table of this type of entity.
\Drupal::database()->insert('example_entity')
->fields([
......@@ -1182,7 +1182,7 @@ function hook_ENTITY_TYPE_insert(Drupal\Core\Entity\EntityInterface $entity) {
* @ingroup entity_crud
* @see hook_ENTITY_TYPE_update()
*/
function hook_entity_update(Drupal\Core\Entity\EntityInterface $entity) {
function hook_entity_update(\Drupal\Core\Entity\EntityInterface $entity) {
// Update the entity's entry in a fictional table of all entities.
\Drupal::database()->update('example_entity')
->fields([
......@@ -1206,7 +1206,7 @@ function hook_entity_update(Drupal\Core\Entity\EntityInterface $entity) {
* @ingroup entity_crud
* @see hook_entity_update()
*/
function hook_ENTITY_TYPE_update(Drupal\Core\Entity\EntityInterface $entity) {
function hook_ENTITY_TYPE_update(\Drupal\Core\Entity\EntityInterface $entity) {
// Update the entity's entry in a fictional table of this type of entity.
\Drupal::database()->update('example_entity')
->fields([
......@@ -1335,7 +1335,7 @@ function hook_ENTITY_TYPE_translation_delete(\Drupal\Core\Entity\EntityInterface
* @ingroup entity_crud
* @see hook_ENTITY_TYPE_predelete()
*/
function hook_entity_predelete(Drupal\Core\Entity\EntityInterface $entity) {
function hook_entity_predelete(\Drupal\Core\Entity\EntityInterface $entity) {
$connection = \Drupal::database();
// Count references to this entity in a custom table before they are removed
// upon entity deletion.
......@@ -1364,7 +1364,7 @@ function hook_entity_predelete(Drupal\Core\Entity\EntityInterface $entity) {
* @ingroup entity_crud
* @see hook_entity_predelete()
*/
function hook_ENTITY_TYPE_predelete(Drupal\Core\Entity\EntityInterface $entity) {
function hook_ENTITY_TYPE_predelete(\Drupal\Core\Entity\EntityInterface $entity) {
$connection = \Drupal::database();
// Count references to this entity in a custom table before they are removed
// upon entity deletion.
......@@ -1395,7 +1395,7 @@ function hook_ENTITY_TYPE_predelete(Drupal\Core\Entity\EntityInterface $entity)
* @ingroup entity_crud
* @see hook_ENTITY_TYPE_delete()
*/
function hook_entity_delete(Drupal\Core\Entity\EntityInterface $entity) {
function hook_entity_delete(\Drupal\Core\Entity\EntityInterface $entity) {
// Delete the entity's entry from a fictional table of all entities.
\Drupal::database()->delete('example_entity')
->condition('type', $entity->getEntityTypeId())
......@@ -1414,7 +1414,7 @@ function hook_entity_delete(Drupal\Core\Entity\EntityInterface $entity) {
* @ingroup entity_crud
* @see hook_entity_delete()
*/
function hook_ENTITY_TYPE_delete(Drupal\Core\Entity\EntityInterface $entity) {
function hook_ENTITY_TYPE_delete(\Drupal\Core\Entity\EntityInterface $entity) {
// Delete the entity's entry from a fictional table of all entities.
\Drupal::database()->delete('example_entity')
->condition('type', $entity->getEntityTypeId())
......@@ -1433,7 +1433,7 @@ function hook_ENTITY_TYPE_delete(Drupal\Core\Entity\EntityInterface $entity) {
* @ingroup entity_crud
* @see hook_ENTITY_TYPE_revision_delete()
*/
function hook_entity_revision_delete(Drupal\Core\Entity\EntityInterface $entity) {
function hook_entity_revision_delete(\Drupal\Core\Entity\EntityInterface $entity) {
$referenced_files_by_field = _editor_get_file_uuids_by_field($entity);
foreach ($referenced_files_by_field as $field => $uuids) {
_editor_delete_file_usage($uuids, $entity, 1);
......@@ -1451,7 +1451,7 @@ function hook_entity_revision_delete(Drupal\Core\Entity\EntityInterface $entity)
* @ingroup entity_crud
* @see hook_entity_revision_delete()
*/
function hook_ENTITY_TYPE_revision_delete(Drupal\Core\Entity\EntityInterface $entity) {
function hook_ENTITY_TYPE_revision_delete(\Drupal\Core\Entity\EntityInterface $entity) {
$referenced_files_by_field = _editor_get_file_uuids_by_field($entity);
foreach ($referenced_files_by_field as $field => $uuids) {
_editor_delete_file_usage($uuids, $entity, 1);
......@@ -1552,7 +1552,7 @@ function hook_ENTITY_TYPE_view(array &$build, \Drupal\Core\Entity\EntityInterfac
* @see hook_entity_view()
* @see hook_ENTITY_TYPE_view_alter()
*/
function hook_entity_view_alter(array &$build, Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display) {
function hook_entity_view_alter(array &$build, \Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display) {
if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) {
// Change its weight.
$build['an_additional_field']['#weight'] = -10;
......@@ -1591,7 +1591,7 @@ function hook_entity_view_alter(array &$build, Drupal\Core\Entity\EntityInterfac
* @see hook_ENTITY_TYPE_view()
* @see hook_entity_view_alter()
*/
function hook_ENTITY_TYPE_view_alter(array &$build, Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display) {
function hook_ENTITY_TYPE_view_alter(array &$build, \Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display) {
if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) {
// Change its weight.
$build['an_additional_field']['#weight'] = -10;
......@@ -1651,7 +1651,7 @@ function hook_entity_prepare_view($entity_type_id, array $entities, array $displ
*
* @ingroup entity_crud
*/
function hook_entity_view_mode_alter(&$view_mode, Drupal\Core\Entity\EntityInterface $entity) {
function hook_entity_view_mode_alter(&$view_mode, \Drupal\Core\Entity\EntityInterface $entity) {
// For nodes, change the view mode when it is teaser.
if ($entity->getEntityTypeId() == 'node' && $view_mode == 'teaser') {
$view_mode = 'my_custom_view_mode';
......@@ -1827,7 +1827,7 @@ function hook_ENTITY_TYPE_prepare_form(\Drupal\Core\Entity\EntityInterface $enti
*
* @ingroup entity_crud
*/
function hook_entity_form_mode_alter(&$form_mode, Drupal\Core\Entity\EntityInterface $entity) {
function hook_entity_form_mode_alter(&$form_mode, \Drupal\Core\Entity\EntityInterface $entity) {
// Change the form mode for users with Administrator role.
if ($entity->getEntityTypeId() == 'user' && $entity->hasRole('administrator')) {
$form_mode = 'my_custom_form_mode';
......
......@@ -96,7 +96,7 @@ public function getItemDefinition() {
/**
* Sets the item definition.
*
* @param \Drupal\Core\TypedData\DataDefinition $definition
* @param \Drupal\Core\TypedData\DataDefinitionInterface $definition
* A list item's data definition.
*
* @return $this
......
......@@ -39,7 +39,7 @@ class BlockPluginId extends ProcessPluginBase implements ContainerFactoryPluginI
* The plugin configuration.
* @param string $plugin_id
* The plugin ID.
* @param mixed $plugin_definition
* @param array $plugin_definition
* The plugin definition.
* @param \Drupal\Core\Entity\EntityStorageInterface $storage
* The block content storage object.
......
......@@ -25,7 +25,7 @@
*
* @see file_validate()
*/
function hook_file_validate(Drupal\file\FileInterface $file) {
function hook_file_validate(\Drupal\file\FileInterface $file) {
$errors = [];
if (!$file->getFilename()) {
......@@ -48,7 +48,7 @@ function hook_file_validate(Drupal\file\FileInterface $file) {
*
* @see file_copy()
*/
function hook_file_copy(Drupal\file\FileInterface $file, Drupal\file\FileInterface $source) {
function hook_file_copy(\Drupal\file\FileInterface $file, \Drupal\file\FileInterface $source) {
// Make sure that the file name starts with the owner's user name.
if (strpos($file->getFilename(), $file->getOwner()->name) !== 0) {
$file->setFilename($file->getOwner()->name . '_' . $file->getFilename());
......@@ -68,7 +68,7 @@ function hook_file_copy(Drupal\file\FileInterface $file, Drupal\file\FileInterfa
*
* @see file_move()
*/
function hook_file_move(Drupal\file\FileInterface $file, Drupal\file\FileInterface $source) {
function hook_file_move(\Drupal\file\FileInterface $file, \Drupal\file\FileInterface $source) {
// Make sure that the file name starts with the owner's user name.
if (strpos($file->getFilename(), $file->getOwner()->name) !== 0) {
$file->setFilename($file->getOwner()->name . '_' . $file->getFilename());
......
......@@ -38,7 +38,7 @@
* For page-specific help, use the route name as identified in the
* module's routing.yml file. For module overview help, the route name
* will be in the form of "help.page.$modulename".
* @param Drupal\Core\Routing\RouteMatchInterface $route_match
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The current route match. This can be used to generate different help
* output for different pages that share the same route.
*
......
......@@ -156,7 +156,7 @@ public function testDisplayConfiguration() {
* The canonical URL of the media asset to test.
* @param string $resource_url
* The oEmbed resource URL of the media asset to test.
* @param mixed $formatter_settings
* @param array $formatter_settings
* Settings for the oEmbed field formatter.
* @param array $selectors
* An array of arrays. Each key is a CSS selector targeting an element in
......
......@@ -737,7 +737,7 @@ public function verifyMenuLink(MenuLinkContent $item, $item_node, MenuLinkConten
/**
* Changes the parent of a menu link using the UI.
*
* @param \Drupal\menu_link_content\MenuLinkContentInterface $item
* @param \Drupal\menu_link_content\MenuLinkContent $item
* The menu link item to move.
* @param int $parent
* The id of the new parent.
......
......@@ -79,7 +79,7 @@ class Download extends FileProcessBase implements ContainerFactoryPluginInterfac
* The plugin configuration.
* @param string $plugin_id
* The plugin ID.
* @param mixed $plugin_definition
* @param array $plugin_definition
* The plugin definition.
* @param \Drupal\Core\File\FileSystemInterface $file_system
* The file system service.
......
......@@ -81,7 +81,7 @@ class FileCopy extends FileProcessBase implements ContainerFactoryPluginInterfac
* The plugin configuration.
* @param string $plugin_id
* The plugin ID.
* @param mixed $plugin_definition
* @param array $plugin_definition
* The plugin definition.
* @param \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrappers
* The stream wrapper manager service.
......
......@@ -25,7 +25,7 @@ abstract class FileProcessBase extends ProcessPluginBase {
* The plugin configuration.
* @param string $plugin_id
* The plugin ID.
* @param mixed $plugin_definition
* @param array $plugin_definition
* The plugin definition.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
......
......@@ -221,7 +221,7 @@ function hook_node_access_records(\Drupal\node\NodeInterface $node) {
* @see hook_node_grants_alter()
* @ingroup node_access
*/
function hook_node_access_records_alter(&$grants, Drupal\node\NodeInterface $node) {
function hook_node_access_records_alter(&$grants, \Drupal\node\NodeInterface $node) {
// Our module allows editors to mark specific articles with the 'is_preview'
// field. If the node being saved has a TRUE value for that field, then only
// our grants are retained, and other grants are removed. Doing so ensures
......
......@@ -69,7 +69,7 @@ function hook_quickedit_editor_alter(&$editors) {
*
* @see \Drupal\Core\Field\FieldItemListInterface::view()
*/
function hook_quickedit_render_field(Drupal\Core\Entity\EntityInterface $entity, $field_name, $view_mode_id, $langcode) {
function hook_quickedit_render_field(\Drupal\Core\Entity\EntityInterface $entity, $field_name, $view_mode_id, $langcode) {
return [
'#prefix' => '<div class="example-markup">',
'field' => $entity->getTranslation($langcode)->get($field_name)->view($view_mode_id),
......
......@@ -2,6 +2,7 @@
namespace Drupal\system\Plugin\migrate\destination;
use Drupal\Core\Datetime\DateFormatInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\migrate\Plugin\migrate\destination\EntityConfigBase;
......@@ -14,11 +15,9 @@ class EntityDateFormat extends EntityConfigBase {
/**
* {@inheritdoc}
*
* @param \Drupal\Core\Datetime\DateFormatInterface $entity
* The date entity.
*/
protected function updateEntityProperty(EntityInterface $entity, array $parents, $value) {
assert($entity instanceof DateFormatInterface);
if ($parents[0] == 'pattern') {
$entity->setPattern($value);
}
......
......@@ -18,7 +18,7 @@
* @param \Drupal\Core\Entity\EntityInterface $entity
* The tour which contains the $tour_tips.
*/
function hook_tour_tips_alter(array &$tour_tips, Drupal\Core\Entity\EntityInterface $entity) {
function hook_tour_tips_alter(array &$tour_tips, \Drupal\Core\Entity\EntityInterface $entity) {
foreach ($tour_tips as $tour_tip) {
if ($tour_tip->get('id') == 'tour-code-test-1') {
$tour_tip->set('body', 'Altered by hook_tour_tips_alter');
......
......@@ -59,7 +59,7 @@ public function query($get_count = FALSE) {}
/**
* Let modules modify the query just prior to finalizing it.
*
* @param view $view
* @param \Drupal\views\ViewExecutable $view
* The view which is executed.
*/
public function alter(ViewExecutable $view) {}
......@@ -67,7 +67,7 @@ public function alter(ViewExecutable $view) {}
/**
* Builds the necessary info to execute the query.
*
* @param view $view
* @param \Drupal\views\ViewExecutable $view
* The view which is executed.
*/
public function build(ViewExecutable $view) {}
......@@ -82,7 +82,7 @@ public function build(ViewExecutable $view) {}
* $view->result should contain an array of objects. The array must use a
* numeric index starting at 0.
*
* @param view $view
* @param \Drupal\views\ViewExecutable $view
* The view which is executed.
*/
public function execute(ViewExecutable $view) {}
......@@ -93,7 +93,7 @@ public function execute(ViewExecutable $view) {}
* This signature is something that can be used when perusing query logs to
* discern where particular queries might be coming from.
*
* @param view $view
* @param \Drupal\views\ViewExecutable $view
* The view which is executed.
*/
public function addSignature(ViewExecutable $view) {}
......
......@@ -92,7 +92,7 @@
* Array of warning messages built by Analyzer::formatMessage to be displayed
* to the user following analysis of the view.
*/
function hook_views_analyze(Drupal\views\ViewExecutable $view) {
function hook_views_analyze(\Drupal\views\ViewExecutable $view) {
$messages = [];
if ($view->display_handler->options['pager']['type'] == 'none') {
......
......@@ -63,9 +63,7 @@
<rule ref="Drupal.Commenting.DocCommentStar"/>
<rule ref="Drupal.Commenting.FileComment"/>
<rule ref="Drupal.Commenting.FunctionComment">
<exclude name="Drupal.Commenting.FunctionComment.IncorrectTypeHint"/>
<exclude name="Drupal.Commenting.FunctionComment.InvalidNoReturn"/>
<exclude name="Drupal.Commenting.FunctionComment.InvalidTypeHint"/>
<exclude name="Drupal.Commenting.FunctionComment.Missing"/>
<exclude name="Drupal.Commenting.FunctionComment.MissingParamComment"/>
<exclude name="Drupal.Commenting.FunctionComment.MissingParamType"/>
......
......@@ -857,7 +857,7 @@ protected function assertNoTitle($title, $message = '', $group = 'Other') {
*
* @param string $callback
* The name of the theme hook to invoke; e.g. 'links' for links.html.twig.
* @param string $variables
* @param array $variables
* An array of variables to pass to the theme function.
* @param string $expected
* The expected themed output string.
......@@ -983,7 +983,7 @@ protected function assertFieldByXPath($xpath, $value = NULL, $message = '', $gro
/**
* Get the selected value from a select field.
*
* @param \SimpleXmlElement $element
* @param \SimpleXMLElement $element
* SimpleXMLElement select element.
*
* @return bool
......
......@@ -115,7 +115,7 @@ public function testInvalidDateArrays($input, $timezone, $class) {
/**
* Tests DateTimePlus::checkArray().
*
* @param mixed $array
* @param array $array
* Input argument for DateTimePlus::checkArray().
* @param bool $expected
* The expected result of DateTimePlus::checkArray().
......
......@@ -83,9 +83,9 @@ protected function setUp(): void {
*
* @param bool $expected
* The expected outcome.
* @param \Drupal\Core\Plugin\Context\EntityContextDefinition $requirement
* @param \Drupal\Core\Plugin\Context\ContextDefinition $requirement
* The requirement to check against.
* @param \Drupal\Core\Plugin\Context\EntityContextDefinition $definition
* @param \Drupal\Core\Plugin\Context\ContextDefinition $definition
* The context definition to check.
* @param mixed $value
* (optional) The value to set on the context, defaults to NULL.
......
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