Unverified Commit 203ad064 authored by Alex Pott's avatar Alex Pott
Browse files

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
Loading
Loading
Loading
Loading
+18 −18
Original line number Diff line number Diff line
@@ -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';
+1 −1
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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.
+3 −3
Original line number Diff line number Diff line
@@ -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());
+1 −1
Original line number Diff line number Diff line
@@ -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.
 *
Loading