From 39327264cc56d652833d395ac952981a89f57514 Mon Sep 17 00:00:00 2001 From: Denis Kolmerschlag Date: Mon, 16 Dec 2024 13:42:10 +0100 Subject: [PATCH] Update phpstan.neon --- .../OrganizerActivityContext.php | 2 +- .../ActivityContext/OwnerActivityContext.php | 7 ++- .../PlatformActivityContext.php | 3 +- .../activity_creator/activity_creator.module | 2 +- .../src/ActivityInterface.php | 3 +- .../Controller/NotificationsController.php | 1 - .../activity_creator/src/Entity/Activity.php | 19 ++++---- .../src/Form/ActivityForm.php | 7 --- .../src/Plugin/ActivityActionBase.php | 3 +- .../src/Plugin/ActivityActionInterface.php | 1 - .../Plugin/ActivityEntityConditionManager.php | 5 ++- .../QueueWorker/ActivityWorkerLogger.php | 4 +- .../QueueWorker/MessageQueueCreator.php | 3 +- .../src/Service/ActivityLoggerFactory.php | 38 ++++++++-------- .../activity_send_email.module | 1 - .../src/EmailFrequencyInterface.php | 2 +- .../JobType/ActivitySendEmailJobType.php | 9 ++-- .../QueueWorker/ActivitySendEmailWorker.php | 6 +-- .../src/Annotation/Push.php | 5 ++- .../Plugin/SendActivityDestinationBase.php | 11 ++--- .../ActivityEntityReferenceFormatter.php | 3 +- .../views/argument/ActivityGroupArgument.php | 3 +- .../argument/ActivityProfileArgument.php | 3 +- .../src/Plugin/views/row/ActivityRow.php | 10 ++--- .../FieldFormatter/FieldDownloadCount.php | 8 ++-- .../custom/dropdown/src/Element/Dropdown.php | 2 +- .../Field/FieldWidget/DropdownWidgetType.php | 2 +- .../src/EntityAccessByFieldPermissions.php | 1 - .../processor/EntityAccessByField.php | 6 +-- .../tests/src/Unit/EntityAccessTest.php | 4 +- .../src/Form/GroupRequestMembershipForm.php | 3 +- .../Form/GroupRequestMembershipRejectForm.php | 3 +- .../group_core_comments.module | 6 +-- .../CommentGroupContentFormatter.php | 8 ++-- .../src/EventSubscriber/MentionsDelete.php | 3 +- .../src/EventSubscriber/MentionsInsert.php | 3 +- .../src/EventSubscriber/MentionsUpdate.php | 3 +- .../mentions/src/Form/MentionsTypeForm.php | 1 - .../custom/social_font/src/Entity/Font.php | 5 ++- .../social_font/src/FontHtmlRouteProvider.php | 3 +- .../custom/social_font/src/Form/FontForm.php | 7 --- .../src/GraphQL/EntityConnection.php | 5 +-- .../GraphQL/Schema/OpenSocialBaseSchema.php | 3 +- .../src/Wrappers/EdgeInterface.php | 2 - .../social_language/social_language.module | 2 +- .../Plugin/UserExportPlugin/UserLanguage.php | 5 ++- .../src/SocialLanguageServiceProvider.php | 1 - .../SocialLazyLoadingTextFormatOverride.php | 3 +- .../social_metatag/social_metatag.module | 3 +- .../social_path_manager.module | 2 +- .../src/Entity/QueueStorageEntity.php | 8 ++-- .../src/Form/QueueStorageEntityForm.php | 8 +--- .../QueueStorageEntityHtmlRouteProvider.php | 5 ++- .../template_suggestions_extra.module | 3 +- .../src/Form/FilterSettingsForm.php | 2 - .../views/filter/ActivityFilterTags.php | 3 +- .../src/EmailTokenServices.php | 10 ++--- .../src/Plugin/views/display/ModeBlock.php | 3 +- .../src/SocialActivityLazyBuilder.php | 3 +- .../social_album/social_album.install | 2 +- .../src/Controller/SocialAlbumController.php | 13 +++--- .../src/Form/SocialAlbumImageForm.php | 3 +- .../SocialAlbumOptionsSelectWidget.php | 4 +- .../field/SocialAlbumEntityOperations.php | 3 +- .../src/Plugin/Block/GroupAddBookBlock.php | 5 ++- .../GraphQL/DataProducer/BrandingLogoUrl.php | 3 +- .../social_comment/social_comment.module | 2 +- .../Controller/SocialCommentController.php | 15 ++++--- .../src/Form/SocialCommentAdminOverview.php | 1 - .../GraphQL/DataProducer/QueryComments.php | 18 ++++---- .../DataProducer/SocialCommentAttachments.php | 30 ++++++++++--- .../Form/SocialCommentUploadSettingsForm.php | 4 +- .../src/SocialContentBlockOverride.php | 6 ++- .../src/EventSubscriber/FlagSubscriber.php | 5 +-- .../src/Form/ContentReportSettingsForm.php | 4 +- .../Plugin/views/field/ReportContentType.php | 3 +- .../social_core/social_core.install | 2 +- .../social_core/social_core.module | 8 ++-- .../src/Entity/EntityAutocompleteMatcher.php | 3 +- .../Select2EntityAutocompleteMatcher.php | 4 +- .../SocialInviteSubscriber.php | 6 ++- .../src/Plugin/Block/SocialPageTitleBlock.php | 3 +- .../FileAndImageTableFormatter.php | 1 - .../src/SocialEmbedConfigOverride.php | 3 +- .../social_event_an_enroll.module | 6 +-- .../Controller/EventAnEnrollController.php | 4 +- .../src/Form/EventAnEnrollActionForm.php | 1 - .../src/Form/EventAnEnrollForm.php | 6 ++- .../Action/SocialEventAnEnrollSendEmail.php | 3 +- .../views/access/ManageEnrollmentAccess.php | 3 +- ...entAnEnrollViewsBulkOperationsBulkForm.php | 31 +++---------- .../src/Plugin/Action/ExportAllEnrolments.php | 9 +++- .../src/Plugin/Action/ExportEnrolments.php | 3 +- .../social_event_invite.module | 4 +- .../Controller/UserEnrollInviteController.php | 5 ++- .../Menu/LocalTask/EventInviteLocalTask.php | 3 +- .../src/SocialEventInviteBulkHelper.php | 9 ++-- .../src/SocialEventInviteConfigOverride.php | 3 +- .../social_event_managers.module | 2 +- .../Action/SocialEventManagersSendEmail.php | 9 ++-- ...entManagersViewsBulkOperationsBulkForm.php | 45 ++++++++----------- .../social_event_max_enroll.module | 2 +- .../social_event/social_event.tokens.inc | 3 +- .../EnrollRequestDialogController.php | 3 +- .../src/Controller/SocialEventController.php | 3 +- .../src/EdaEventEnrollmentHandler.php | 1 - .../src/Entity/EventEnrollment.php | 5 ++- .../src/EventEnrollmentStatusHelper.php | 19 ++++---- .../src/Form/EnrollActionForm.php | 18 +++++--- .../src/Form/EnrollRequestDeclineForm.php | 2 +- .../src/Form/EventEnrollmentForm.php | 7 --- .../EventRequestEnrollmentNotification.php | 5 +-- .../DataProducer/Field/DateToTimestamp.php | 3 +- .../src/Plugin/views/filter/EventDate.php | 8 ++-- .../views/filter/EventEnrolledOrCreated.php | 12 +++-- .../src/Plugin/views/sort/EventDate.php | 3 +- .../social_follow_content.module | 3 +- .../FollowContentActivityContext.php | 2 - .../FollowTagActivityContext.php | 4 +- .../social_follow_taxonomy.module | 3 +- .../FollowTaxonomyActivityContext.php | 1 + .../FlexibleGroupContentVisibilityUpdate.php | 13 +++--- .../src/Form/SocialBulkGroupInvitation.php | 4 +- .../Plugin/Action/SocialGroupInviteResend.php | 3 +- .../src/SocialGroupInviteConfigOverride.php | 3 +- .../src/Controller/GroupRequestController.php | 3 +- .../social_group_welcome_message.module | 3 +- .../social_group/src/CrossPostingService.php | 3 +- .../src/Form/SocialGroupSettings.php | 3 +- .../src/Plugin/Action/AddMembersToGroup.php | 6 ++- .../Action/ChangeGroupMembershipRole.php | 3 +- .../Action/GroupContentEntityDeleteAction.php | 3 +- .../FieldWidget/SocialGroupSelectorWidget.php | 1 - .../social_landing_page.module | 3 +- .../Field/FieldFormatter/BlockIdFormatter.php | 1 - .../ActivityContext/VoteActivityContext.php | 3 +- .../social_node/src/SocialNodeForm.php | 3 +- .../social_post_album.module | 2 +- .../Element/SocialPostAlbumManagedFile.php | 3 +- .../FieldFormatter/AlbumImageFormatter.php | 3 +- .../social_features/social_post/post.page.inc | 3 +- .../social_post/social_post.admin.inc | 4 +- .../social_post/social_post.module | 9 ++-- .../social_post/social_post.post_update.php | 8 ++-- .../social_post/src/Entity/Post.php | 8 ++-- .../social_post/src/Form/PostForm.php | 3 +- .../src/Form/PostTypeDeleteForm.php | 5 ++- .../Plugin/views/area/SocialPostPostForm.php | 3 +- .../src/PostAccessControlHandler.php | 3 +- .../social_post/src/PostHtmlRouteProvider.php | 3 +- .../social_post/src/PostViewBuilder.php | 18 +++----- .../social_private_message.module | 2 +- .../UserSelection.php | 5 ++- .../UserAnalyticsPrivateMessage.php | 3 +- .../social_profile_fields.module | 5 ++- .../Form/SocialProfileFieldsSettingsForm.php | 1 - .../src/SocialProfileFieldsBatch.php | 3 +- .../social_profile_organization_tag.module | 3 +- .../social_profile_privacy.module | 2 +- .../social_profile/social_profile.module | 3 -- .../UserSelection.php | 6 +-- .../views/field/ProfileEntitySortable.php | 7 ++- .../src/Form/SearchContentForm.php | 1 - .../social_search/src/Form/SearchHeroForm.php | 1 - .../social_sharing/social_sharing.module | 2 +- .../src/Plugin/EmailAdjuster/Reroute.php | 3 +- .../src/Form/SocialTaggingSettingsForm.php | 1 - .../ContentExportPlugin/ContentTags.php | 4 +- .../social_topic/social_topic.module | 3 +- .../social_user/social_user.post_update.php | 1 - .../social_user/src/EdaHandler.php | 1 + .../Form/SocialUserNavigationSettingsForm.php | 1 - .../src/Plugin/Action/SocialAddRoleUser.php | 8 +--- .../src/Plugin/Action/SocialBlockUser.php | 3 +- .../Plugin/Action/SocialRemoveRoleUser.php | 4 +- .../src/Plugin/Action/SocialSendEmail.php | 4 +- .../SchemaExtension/UserSchemaExtension.php | 3 +- .../src/Plugin/views/access/PeopleAccess.php | 3 +- .../src/Plugin/Action/ExportUser.php | 21 +++++---- phpstan.neon | 17 ++++--- .../behat/features/bootstrap/GroupContext.php | 6 +-- .../bootstrap/SocialDrupalContext.php | 8 ++-- .../behat/features/bootstrap/TopicContext.php | 10 ++--- .../install_example/install_example.install | 3 +- .../private_function_example.module | 3 +- 185 files changed, 468 insertions(+), 510 deletions(-) diff --git a/modules/custom/activity_basics/src/Plugin/ActivityContext/OrganizerActivityContext.php b/modules/custom/activity_basics/src/Plugin/ActivityContext/OrganizerActivityContext.php index ed7af2a0bfe..0e3b18ee804 100644 --- a/modules/custom/activity_basics/src/Plugin/ActivityContext/OrganizerActivityContext.php +++ b/modules/custom/activity_basics/src/Plugin/ActivityContext/OrganizerActivityContext.php @@ -128,7 +128,7 @@ public function getRecipientOrganizerFromEntity(array $related_entity, array $da && $original_related_object['target_type'] === 'event_enrollment' && $related_entity !== NULL) { $storage = $this->entityTypeManager->getStorage($related_entity['target_type']); - /** @var EventEnrollmentInterface|NULL $event */ + /** @var \Drupal\social_event\EventEnrollmentInterface|NULL $event */ $event = $storage->load($related_entity['target_id']); if ($event === NULL) { diff --git a/modules/custom/activity_basics/src/Plugin/ActivityContext/OwnerActivityContext.php b/modules/custom/activity_basics/src/Plugin/ActivityContext/OwnerActivityContext.php index 4e0fb4a9c66..f4a77688449 100644 --- a/modules/custom/activity_basics/src/Plugin/ActivityContext/OwnerActivityContext.php +++ b/modules/custom/activity_basics/src/Plugin/ActivityContext/OwnerActivityContext.php @@ -4,7 +4,6 @@ use Drupal\activity_creator\ActivityFactory; use Drupal\activity_creator\Plugin\ActivityContextBase; -use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\Query\Sql\QueryFactory; use Drupal\group\Entity\GroupInterface; @@ -120,7 +119,7 @@ public function getRecipientOwnerFromEntity(array $related_entity, array $data): $recipients = []; $entity_storage = $this->entityTypeManager->getStorage($related_entity['target_type']); - /** @var EntityOwnerInterface|NULL $entity */ + /** @var \Drupal\user\EntityOwnerInterface|NULL $entity */ $entity = $entity_storage->load($related_entity['target_id']); // It could happen that a notification has been queued but the content @@ -134,7 +133,7 @@ public function getRecipientOwnerFromEntity(array $related_entity, array $data): $original_related_object = $data['related_object'][0]; if (isset($original_related_object['target_type']) && $original_related_object['target_type'] === 'comment') { $storage = $this->entityTypeManager->getStorage($original_related_object['target_type']); - /** @var EntityOwnerInterface $original_related_entity */ + /** @var \Drupal\user\EntityOwnerInterface $original_related_entity */ $original_related_entity = $storage->load($original_related_object['target_id']); if ($original_related_entity !== NULL && $original_related_entity->getOwnerId() === $entity->getOwnerId()) { @@ -144,7 +143,7 @@ public function getRecipientOwnerFromEntity(array $related_entity, array $data): if ($entity instanceof EntityOwnerInterface) { $account = $entity->getOwner(); - /** @var EntityInterface $entity */ + /** @var \Drupal\Core\Entity\EntityInterface $entity */ $group = $this->groupMuteNotify->getGroupByContent($entity); // Check if we have $group set which means that this content was // posted in a group. diff --git a/modules/custom/activity_basics/src/Plugin/ActivityContext/PlatformActivityContext.php b/modules/custom/activity_basics/src/Plugin/ActivityContext/PlatformActivityContext.php index 7f6fe0ba824..5f6406fb087 100644 --- a/modules/custom/activity_basics/src/Plugin/ActivityContext/PlatformActivityContext.php +++ b/modules/custom/activity_basics/src/Plugin/ActivityContext/PlatformActivityContext.php @@ -3,7 +3,6 @@ namespace Drupal\activity_basics\Plugin\ActivityContext; use Drupal\activity_creator\Plugin\ActivityContextBase; -use Drupal\user\EntityOwnerInterface; /** * Provides a 'OwnerActivityContext' activity context. @@ -37,7 +36,7 @@ public function getRecipients(array $data, int $last_id, int $limit): array { // Add the owner of the related entity as a recipient. // No owner found set user 1. - /** @var EntityOwnerInterface $entity*/ + /** @var \Drupal\user\EntityOwnerInterface $entity*/ $recipients[] = [ 'target_type' => 'user', 'target_id' => $entity->getOwnerId() ?? 1, diff --git a/modules/custom/activity_creator/activity_creator.module b/modules/custom/activity_creator/activity_creator.module index 70ba339bbe7..5e3773d7d29 100644 --- a/modules/custom/activity_creator/activity_creator.module +++ b/modules/custom/activity_creator/activity_creator.module @@ -172,7 +172,7 @@ function activity_creator_activity_insert(ActivityInterface $activity): void { // notifications. if (in_array('notifications', $activity->getDestinations(), TRUE)) { // Get recipients. - /** @var Activity $activity */ + /** @var \Drupal\activity_creator\Entity\Activity $activity */ $recipients = $activity->getRecipient(); if (is_array($recipients)) { diff --git a/modules/custom/activity_creator/src/ActivityInterface.php b/modules/custom/activity_creator/src/ActivityInterface.php index ac9fc74a707..928a1b5875f 100644 --- a/modules/custom/activity_creator/src/ActivityInterface.php +++ b/modules/custom/activity_creator/src/ActivityInterface.php @@ -2,6 +2,7 @@ namespace Drupal\activity_creator; +use Drupal\Core\Url; use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\EntityChangedInterface; use Drupal\user\EntityOwnerInterface; @@ -59,7 +60,7 @@ public function setPublished(bool $published): ActivityInterface; * @return \Drupal\Core\Url|string * Empty string if entity canonical url could not be found. */ - public function getRelatedEntityUrl(): string|\Drupal\Core\Url; + public function getRelatedEntityUrl(): string|Url; /** * Get destinations. diff --git a/modules/custom/activity_creator/src/Controller/NotificationsController.php b/modules/custom/activity_creator/src/Controller/NotificationsController.php index a6c0b192452..79f86de8138 100644 --- a/modules/custom/activity_creator/src/Controller/NotificationsController.php +++ b/modules/custom/activity_creator/src/Controller/NotificationsController.php @@ -65,7 +65,6 @@ public function getNotificationListCallback(): AjaxResponse { ? '0' : (string) count($this->activities->getNotifications($this->currentUser())); - // $notification_count = $this->activities->markAllNotificationsAsSeen($this->currentUser()) ? 0 : count($this->activities->getNotifications($this->currentUser())); $response->addCommand(new HtmlCommand('.notification-bell .badge', $notification_count)); return $response; diff --git a/modules/custom/activity_creator/src/Entity/Activity.php b/modules/custom/activity_creator/src/Entity/Activity.php index 6e959d54682..2f4a8ed6d09 100644 --- a/modules/custom/activity_creator/src/Entity/Activity.php +++ b/modules/custom/activity_creator/src/Entity/Activity.php @@ -2,6 +2,8 @@ namespace Drupal\activity_creator\Entity; +use Drupal\Core\Entity\EntityInterface; +use Drupal\user\EntityOwnerInterface; use Drupal\Core\Config\Entity\ConfigEntityStorage; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Field\BaseFieldDefinition; @@ -11,11 +13,8 @@ use Drupal\activity_creator\ActivityInterface; use Drupal\Core\Url; use Drupal\flag\Entity\Flagging; -use Drupal\group\Entity\Storage\GroupRelationshipStorage; use Drupal\user\UserInterface; use Drupal\node\NodeInterface; -use Drupal\votingapi\Entity\Vote; -use Drupal\votingapi\VoteStorage; /** * Defines the Activity entity. @@ -94,7 +93,7 @@ public function setCreatedTime(int $timestamp): ActivityInterface|static { * {@inheritdoc} */ public function getOwner(): UserInterface { - /** @var UserInterface $user */ + /** @var \Drupal\user\UserInterface $user */ $user = $this->get('user_id')->entity; return $user; } @@ -109,7 +108,7 @@ public function getOwnerId(): ?int { /** * {@inheritdoc} */ - public function setOwnerId($uid): \Drupal\user\EntityOwnerInterface|Activity|static { + public function setOwnerId($uid): EntityOwnerInterface|Activity|static { $this->set('user_id', $uid); return $this; } @@ -117,7 +116,7 @@ public function setOwnerId($uid): \Drupal\user\EntityOwnerInterface|Activity|sta /** * {@inheritdoc} */ - public function setOwner(UserInterface $account): \Drupal\user\EntityOwnerInterface|Activity|static { + public function setOwner(UserInterface $account): EntityOwnerInterface|Activity|static { $this->set('user_id', $account->id()); return $this; } @@ -207,7 +206,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type): a * @return \Drupal\Core\Entity\EntityInterface|null * Returns NULL or Entity object. */ - public function getRelatedEntity(): ?\Drupal\Core\Entity\EntityInterface { + public function getRelatedEntity(): ?EntityInterface { $related_object = $this->get('field_activity_entity')->getValue(); if (!empty($related_object)) { $target_type = $related_object['0']['target_type']; @@ -249,16 +248,16 @@ public function getRelatedEntityUrl(): string|Url { // Make an exception for Votes. if ($target_type === 'vote') { - /** @var VoteStorage $vote_storage */ + /** @var \Drupal\votingapi\VoteStorage $vote_storage */ $vote_storage = \Drupal::entityTypeManager()->getStorage($target_type); if ($vote = $vote_storage->load($target_id)) { - /** @var Vote $vote */ + /** @var \Drupal\votingapi\Entity\Vote $vote */ $target_type = $vote->getVotedEntityType(); $target_id = $vote->getVotedEntityId(); } } elseif ($target_type === 'group_content') { - /** @var GroupRelationshipStorage $group_content_storage */ + /** @var \Drupal\group\Entity\Storage\GroupRelationshipStorage $group_content_storage */ $group_content_storage = \Drupal::service('entity_type.manager')->getStorage($target_type); if ($group_content = $group_content_storage->load($target_id)) { /** @var \Drupal\group\Entity\GroupRelationship $group_content */ diff --git a/modules/custom/activity_creator/src/Form/ActivityForm.php b/modules/custom/activity_creator/src/Form/ActivityForm.php index 6921e848b3f..38888c7ed20 100644 --- a/modules/custom/activity_creator/src/Form/ActivityForm.php +++ b/modules/custom/activity_creator/src/Form/ActivityForm.php @@ -12,13 +12,6 @@ */ class ActivityForm extends ContentEntityForm { - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state): array { - return parent::buildForm($form, $form_state); - } - /** * {@inheritdoc} */ diff --git a/modules/custom/activity_creator/src/Plugin/ActivityActionBase.php b/modules/custom/activity_creator/src/Plugin/ActivityActionBase.php index f699292997b..b255fdc23fb 100644 --- a/modules/custom/activity_creator/src/Plugin/ActivityActionBase.php +++ b/modules/custom/activity_creator/src/Plugin/ActivityActionBase.php @@ -5,7 +5,6 @@ use Drupal\activity_logger\Entity\NotificationConfigEntityInterface; use Drupal\Component\Plugin\PluginBase; use Drupal\Core\Entity\ContentEntityInterface; -use Drupal\Core\Entity\EntityBase; use Drupal\Core\Entity\EntityInterface; /** @@ -29,7 +28,7 @@ public function createMessage(EntityInterface $entity): void { // Use the queue logger. $activity_logger_factory = \Drupal::service('activity_logger.activity_factory'); // Create messages for all other types of content. - /** @var EntityBase $entity */ + /** @var \Drupal\Core\Entity\EntityBase $entity */ $activity_logger_factory->createMessages($entity, $this->pluginId); } diff --git a/modules/custom/activity_creator/src/Plugin/ActivityActionInterface.php b/modules/custom/activity_creator/src/Plugin/ActivityActionInterface.php index b9b4b01cc4d..e7c49190638 100644 --- a/modules/custom/activity_creator/src/Plugin/ActivityActionInterface.php +++ b/modules/custom/activity_creator/src/Plugin/ActivityActionInterface.php @@ -4,7 +4,6 @@ use Drupal\Component\Plugin\PluginInspectionInterface; use Drupal\Core\Entity\EntityInterface; -use Drupal\system\Entity\Action; /** * Defines an interface for Activity action plugins. diff --git a/modules/custom/activity_creator/src/Plugin/ActivityEntityConditionManager.php b/modules/custom/activity_creator/src/Plugin/ActivityEntityConditionManager.php index 6c44a0d5689..39f54fb4731 100644 --- a/modules/custom/activity_creator/src/Plugin/ActivityEntityConditionManager.php +++ b/modules/custom/activity_creator/src/Plugin/ActivityEntityConditionManager.php @@ -6,6 +6,7 @@ use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Component\Utility\Html; +use Drupal\activity_creator\Annotation\ActivityEntityCondition; /** * Provides the Activity entity condition plugin manager. @@ -24,7 +25,7 @@ class ActivityEntityConditionManager extends DefaultPluginManager { * The module handler to invoke the alter hook with. */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { - parent::__construct('Plugin/ActivityEntityCondition', $namespaces, $module_handler, 'Drupal\activity_creator\Plugin\ActivityEntityConditionInterface', 'Drupal\activity_creator\Annotation\ActivityEntityCondition'); + parent::__construct('Plugin/ActivityEntityCondition', $namespaces, $module_handler, ActivityEntityConditionInterface::class, ActivityEntityCondition::class); $this->alterInfo('activity_creator_activity_entity_condition_info'); $this->setCacheBackend($cache_backend, 'activity_creator_activity_entity_condition_plugins'); @@ -40,7 +41,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac * An associative array mapping the IDs of all available tracker plugins to * their labels. */ - public function getOptionsList(array $entities = []) { + public function getOptionsList(array $entities = []): array { $options = []; foreach ($entities as $entity) { diff --git a/modules/custom/activity_creator/src/Plugin/QueueWorker/ActivityWorkerLogger.php b/modules/custom/activity_creator/src/Plugin/QueueWorker/ActivityWorkerLogger.php index 05f0860e7a4..711d0bc3222 100644 --- a/modules/custom/activity_creator/src/Plugin/QueueWorker/ActivityWorkerLogger.php +++ b/modules/custom/activity_creator/src/Plugin/QueueWorker/ActivityWorkerLogger.php @@ -2,6 +2,8 @@ namespace Drupal\activity_creator\Plugin\QueueWorker; +use Drupal\Core\State\StateInterface; + /** * A report worker. * @@ -22,7 +24,7 @@ class ActivityWorkerLogger extends ActivityWorkerBase { * * @var \Drupal\Core\State\StateInterface */ - protected \Drupal\Core\State\StateInterface $state; + protected StateInterface $state; /** * {@inheritdoc} diff --git a/modules/custom/activity_logger/src/Plugin/QueueWorker/MessageQueueCreator.php b/modules/custom/activity_logger/src/Plugin/QueueWorker/MessageQueueCreator.php index f5138917728..572d01b716c 100644 --- a/modules/custom/activity_logger/src/Plugin/QueueWorker/MessageQueueCreator.php +++ b/modules/custom/activity_logger/src/Plugin/QueueWorker/MessageQueueCreator.php @@ -2,7 +2,6 @@ namespace Drupal\activity_logger\Plugin\QueueWorker; -use Drupal\activity_creator\Plugin\ActivityActionInterface; use Drupal\activity_creator\Plugin\ActivityActionManager; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Queue\QueueFactory; @@ -84,7 +83,7 @@ public function processItem($data): void { else { // Trigger the creation action for entities. if ($this->actionManager->hasDefinition('create_entitiy_action')) { - /** @var ActivityActionInterface $create_action */ + /** @var \Drupal\activity_creator\Plugin\ActivityActionInterface $create_action */ $create_action = $this->actionManager->createInstance('create_entitiy_action'); $create_action->createMessage($entity); } diff --git a/modules/custom/activity_logger/src/Service/ActivityLoggerFactory.php b/modules/custom/activity_logger/src/Service/ActivityLoggerFactory.php index 931f54b9ee4..e9720b67c99 100644 --- a/modules/custom/activity_logger/src/Service/ActivityLoggerFactory.php +++ b/modules/custom/activity_logger/src/Service/ActivityLoggerFactory.php @@ -2,15 +2,10 @@ namespace Drupal\activity_logger\Service; -use Drupal\activity_creator\Plugin\ActivityContextInterface; use Drupal\activity_creator\Plugin\ActivityContextManager; -use Drupal\activity_creator\Plugin\ActivityEntityConditionInterface; use Drupal\activity_creator\Plugin\ActivityEntityConditionManager; use Drupal\activity_logger\Entity\NotificationConfigEntityInterface; -use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\EntityBase; -use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\field\FieldConfigInterface; @@ -120,7 +115,7 @@ public function createMessages(EntityBase $entity, string $action): void { $new_message['field_message_destination'] = $destinations; if ($entity instanceof NotificationConfigEntityInterface) { - /** @var EntityBase $entity_base */ + /** @var \Drupal\Core\Entity\EntityBase $entity_base */ $entity_base = $entity; $new_message['field_message_related_object'] = [ 'target_type' => $entity_base->getEntityTypeId(), @@ -129,18 +124,18 @@ public function createMessages(EntityBase $entity, string $action): void { $new_message['created'] = $entity->getCreatedTime(); } else { - /** @var EntityInterface $entity */ + /** @var \Drupal\Core\Entity\EntityInterface $entity */ $new_message['field_message_related_object'] = [ 'target_type' => $entity->getEntityTypeId(), 'target_id' => $entity->id(), ]; // The flagging entity does not implement getCreatedTime(). if ($entity->getEntityTypeId() === 'flagging') { - /** @var ContentEntityInterface $entity */ + /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ $new_message['created'] = $entity->get('created')->value; } else { - /** @var NotificationConfigEntityInterface $entity */ + /** @var \Drupal\activity_logger\Entity\NotificationConfigEntityInterface $entity */ $new_message['created'] = $entity->getCreatedTime(); } } @@ -178,12 +173,12 @@ public function getMessageTypes(string $action, EntityBase $entity): array { // Check all enabled messages. foreach ($message_storage->loadByProperties(['status' => '1']) as $key => $message_type) { - /** @var ConfigEntityBase $message_type */ + /** @var \Drupal\Core\Config\Entity\ConfigEntityBase $message_type */ $mt_entity_bundles = $message_type->getThirdPartySetting('activity_logger', 'activity_bundle_entities', []); $mt_action = $message_type->getThirdPartySetting('activity_logger', 'activity_action', NULL); $mt_context = $message_type->getThirdPartySetting('activity_logger', 'activity_context', NULL); $mt_destinations = $message_type->getThirdPartySetting('activity_logger', 'activity_destinations', NULL); - $mt_entity_condition = $message_type->getThirdPartySetting('activity_logger', 'activity_entity_condition', NULL); + $mt_entity_condition = (string) $message_type->getThirdPartySetting('activity_logger', 'activity_entity_condition', NULL); if ($mt_action !== $action) { continue; @@ -198,19 +193,22 @@ public function getMessageTypes(string $action, EntityBase $entity): array { continue; } - /** @var ActivityEntityConditionInterface $entity_condition */ - /** @var ContentEntityInterface $entity */ - $entity_condition = $this->activityEntityConditionManager->createInstance($mt_entity_condition); - if ( - !empty($mt_entity_condition) - && $this->activityEntityConditionManager->hasDefinition($mt_entity_condition) - && !$entity_condition->isValidEntityCondition($entity) - ) { + if (!empty($mt_entity_condition)) { continue; } - /** @var ActivityContextInterface $context_plugin */ + if ($this->activityEntityConditionManager->hasDefinition($mt_entity_condition)) { + continue; + } + + /** @var \Drupal\activity_creator\Plugin\ActivityEntityConditionInterface $context_plugin */ $context_plugin = $this->activityContextManager->createInstance($mt_context); + /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ + if (!$context_plugin->isValidEntityCondition($entity)) { + continue; + } + + /** @var \Drupal\activity_creator\Plugin\ActivityContextInterface $context_plugin */ if ($context_plugin->isValidEntity($entity)) { $message_types[$key] = [ 'messagetype' => $message_type, diff --git a/modules/custom/activity_send/modules/activity_send_email/activity_send_email.module b/modules/custom/activity_send/modules/activity_send_email/activity_send_email.module index 0f5c431f6bf..e7d0ce178d5 100755 --- a/modules/custom/activity_send/modules/activity_send_email/activity_send_email.module +++ b/modules/custom/activity_send/modules/activity_send_email/activity_send_email.module @@ -169,7 +169,6 @@ function activity_send_email_form_user_form_alter(array &$form, FormStateInterfa $user_email_settings = EmailActivityDestination::getSendEmailUserSettings($account); - foreach ($items as $item_id => $item) { // Don't render the fieldset when there are no templates. if (empty($item['templates'])) { diff --git a/modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyInterface.php b/modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyInterface.php index 39701ae4942..9aec482ee6c 100644 --- a/modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyInterface.php +++ b/modules/custom/activity_send/modules/activity_send_email/src/EmailFrequencyInterface.php @@ -48,6 +48,6 @@ public function getInterval(): int; * @param string|null $body_text * The output text of message. */ - public function processItem(Activity $activity, Message $message, User $target, ?string$body_text = NULL): void ; + public function processItem(Activity $activity, Message $message, User $target, ?string $body_text = NULL): void; } diff --git a/modules/custom/activity_send/modules/activity_send_email/src/Plugin/AdvancedQueue/JobType/ActivitySendEmailJobType.php b/modules/custom/activity_send/modules/activity_send_email/src/Plugin/AdvancedQueue/JobType/ActivitySendEmailJobType.php index 78c8597ba79..d798936fdfb 100644 --- a/modules/custom/activity_send/modules/activity_send_email/src/Plugin/AdvancedQueue/JobType/ActivitySendEmailJobType.php +++ b/modules/custom/activity_send/modules/activity_send_email/src/Plugin/AdvancedQueue/JobType/ActivitySendEmailJobType.php @@ -2,6 +2,7 @@ namespace Drupal\activity_send_email\Plugin\AdvancedQueue\JobType; +use Drupal\Core\Config\ImmutableConfig; use Drupal\activity_creator\ActivityNotifications; use Drupal\activity_send_email\EmailFrequencyManager; use Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination; @@ -11,7 +12,6 @@ use Drupal\advancedqueue\Plugin\AdvancedQueue\JobType\JobTypeBase; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Database\Connection; -use Drupal\Core\Database\StatementInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Language\LanguageManager; @@ -62,7 +62,7 @@ class ActivitySendEmailJobType extends JobTypeBase implements ContainerFactoryPl * * @var \Drupal\Core\Config\ImmutableConfig */ - protected \Drupal\Core\Config\ImmutableConfig $socialMailerSettings; + protected ImmutableConfig $socialMailerSettings; /** * The entity type manager. @@ -172,15 +172,14 @@ public function process(Job $job): JobResult { foreach ($this->languageManager->getLanguages() as $language) { $langcode = $language->getId(); // Load all user by given language. - /** @var StatementInterface $result */ - $result = $this->database->select('users_field_data', 'ufd') + /** @var \Drupal\Core\Database\StatementInterface $result */ + $result = $this->database->select('users_field_data', 'ufd') ->fields('ufd', ['uid']) ->condition('uid', $recipients, 'IN') ->condition('preferred_langcode', $langcode) ->execute(); $user_ids_per_language = $result->fetchAllKeyed(0, 0); - // Prepare the batch per language. $this->prepareBatch($data, $user_ids_per_language, $langcode); } diff --git a/modules/custom/activity_send/modules/activity_send_email/src/Plugin/QueueWorker/ActivitySendEmailWorker.php b/modules/custom/activity_send/modules/activity_send_email/src/Plugin/QueueWorker/ActivitySendEmailWorker.php index 22c244ddf7c..c85ed0e0cf5 100644 --- a/modules/custom/activity_send/modules/activity_send_email/src/Plugin/QueueWorker/ActivitySendEmailWorker.php +++ b/modules/custom/activity_send/modules/activity_send_email/src/Plugin/QueueWorker/ActivitySendEmailWorker.php @@ -2,13 +2,13 @@ namespace Drupal\activity_send_email\Plugin\QueueWorker; +use Drupal\Core\Config\ImmutableConfig; use Drupal\activity_creator\ActivityNotifications; use Drupal\activity_send\Plugin\QueueWorker\ActivitySendWorkerBase; use Drupal\activity_send_email\EmailFrequencyManager; use Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Database\Connection; -use Drupal\Core\Database\StatementInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Language\LanguageManager; @@ -58,7 +58,7 @@ class ActivitySendEmailWorker extends ActivitySendWorkerBase implements Containe * * @var \Drupal\Core\Config\ImmutableConfig */ - protected \Drupal\Core\Config\ImmutableConfig $socialMailerSettings; + protected ImmutableConfig $socialMailerSettings; /** * The entity type manager. @@ -163,7 +163,7 @@ public function processItem($data): void { foreach ($languages = $this->languageManager->getLanguages() as $language) { $langcode = $language->getId(); // Load all user by given language. - /** @var StatementInterface $result */ + /** @var \Drupal\Core\Database\StatementInterface $result */ $result = $this->database->select('users_field_data', 'ufd') ->fields('ufd', ['uid']) ->condition('uid', $recipients, 'IN') diff --git a/modules/custom/activity_send/modules/activity_send_push_notification/src/Annotation/Push.php b/modules/custom/activity_send/modules/activity_send_push_notification/src/Annotation/Push.php index 70505f5b24c..2624104ecec 100644 --- a/modules/custom/activity_send/modules/activity_send_push_notification/src/Annotation/Push.php +++ b/modules/custom/activity_send/modules/activity_send_push_notification/src/Annotation/Push.php @@ -2,6 +2,7 @@ namespace Drupal\activity_send_push_notification\Annotation; +use Drupal\Core\Annotation\Translation; use Drupal\Component\Annotation\Plugin; /** @@ -25,7 +26,7 @@ class Push extends Plugin { * * @ingroup plugin_translatable */ - public \Drupal\Core\Annotation\Translation $title; + public Translation $title; /** * The description of form elements set. @@ -34,7 +35,7 @@ class Push extends Plugin { * * @ingroup plugin_translatable */ - public ?\Drupal\Core\Annotation\Translation $description = NULL; + public ?Translation $description = NULL; /** * The plugin weight. diff --git a/modules/custom/activity_send/src/Plugin/SendActivityDestinationBase.php b/modules/custom/activity_send/src/Plugin/SendActivityDestinationBase.php index 47f24dcc4ea..dc5bab318b8 100644 --- a/modules/custom/activity_send/src/Plugin/SendActivityDestinationBase.php +++ b/modules/custom/activity_send/src/Plugin/SendActivityDestinationBase.php @@ -2,6 +2,7 @@ namespace Drupal\activity_send\Plugin; +use Drupal\Core\Database\StatementInterface; use Drupal\activity_creator\Entity\Activity; use Drupal\activity_creator\Plugin\ActivityDestinationBase; use Drupal\social_user\Entity\User; @@ -58,7 +59,7 @@ public static function getSendUserSettings(string $destination, User $account): $query->condition('uas.destination', $destination); $result = $query->execute(); - if ($result instanceof \Drupal\Core\Database\StatementInterface) { + if ($result instanceof StatementInterface) { return $result->fetchAllKeyed(); } @@ -88,7 +89,7 @@ public static function getSendAllUsersSetting(string $destination, array $accoun $query->condition('uas.message_template', $message_template_id); $result = $query->execute(); - if ($result instanceof \Drupal\Core\Database\StatementInterface) { + if ($result instanceof StatementInterface) { return $result->fetchAllKeyed(); } @@ -122,7 +123,7 @@ public static function getSendUserIdsByFrequency(string $destination, array $acc $query->distinct(); $result = $query->execute(); - if ($result instanceof \Drupal\Core\Database\StatementInterface) { + if ($result instanceof StatementInterface) { return $result->fetchAllKeyed(0, 0); } @@ -180,7 +181,7 @@ public static function getSendTargetUser(Activity $activity): ?User { && !empty($activity->get('field_activity_recipient_user')->target_id) ) { $target_id = $activity->get('field_activity_recipient_user')->target_id; - /** @var User $target_account */ + /** @var \Drupal\social_user\Entity\User $target_account */ $target_account = \Drupal::entityTypeManager() ->getStorage('user') ->load($target_id); @@ -237,7 +238,7 @@ public static function isUserOffline(User $account): bool { $query->condition('s.uid', $account->id()); $result = $query->execute(); - $last_activity_time = $result instanceof \Drupal\Core\Database\StatementInterface ? $result->fetchField() : NULL; + $last_activity_time = $result instanceof StatementInterface ? $result->fetchField() : NULL; $offline_window = \Drupal::config('activity_send.settings')->get('activity_send_offline_window'); $current_time = \Drupal::time()->getRequestTime() - $offline_window; diff --git a/modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php b/modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php index 9a984c49076..2c062c47817 100644 --- a/modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php +++ b/modules/custom/activity_viewer/src/Plugin/Field/FieldFormatter/ActivityEntityReferenceFormatter.php @@ -2,7 +2,6 @@ namespace Drupal\activity_viewer\Plugin\Field\FieldFormatter; -use Drupal\Core\Field\EntityReferenceFieldItemListInterface; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\dynamic_entity_reference\Plugin\Field\FieldFormatter\DynamicEntityReferenceEntityFormatter; @@ -25,7 +24,7 @@ class ActivityEntityReferenceFormatter extends DynamicEntityReferenceEntityForma * {@inheritdoc} */ public function viewElements(FieldItemListInterface $items, $langcode): array { - /** @var EntityReferenceFieldItemListInterface $items */ + /** @var \Drupal\Core\Field\EntityReferenceFieldItemListInterface $items */ $view_mode = $this->getSetting('view_mode'); $elements = []; diff --git a/modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php b/modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php index dd6f6f49f38..86c29845fb5 100644 --- a/modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php +++ b/modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php @@ -4,7 +4,6 @@ use Drupal\Core\Database\Query\Condition; use Drupal\views\Plugin\views\argument\ArgumentPluginBase; -use Drupal\views\Plugin\views\query\Sql; /** * Default implementation of the base argument plugin. @@ -23,7 +22,7 @@ class ActivityGroupArgument extends ArgumentPluginBase { public function query($group_by = FALSE): void { $this->ensureMyTable(); - /** @var Sql $query */ + /** @var \Drupal\views\Plugin\views\query\Sql $query */ $query = $this->query; // \Drupal\views\Plugin\views\query\QueryPluginBase. diff --git a/modules/custom/activity_viewer/src/Plugin/views/argument/ActivityProfileArgument.php b/modules/custom/activity_viewer/src/Plugin/views/argument/ActivityProfileArgument.php index 14470b327b6..7de4955a360 100644 --- a/modules/custom/activity_viewer/src/Plugin/views/argument/ActivityProfileArgument.php +++ b/modules/custom/activity_viewer/src/Plugin/views/argument/ActivityProfileArgument.php @@ -4,7 +4,6 @@ use Drupal\Core\Database\Query\Condition; use Drupal\views\Plugin\views\argument\ArgumentPluginBase; -use Drupal\views\Plugin\views\query\Sql; /** * Default implementation of the base argument plugin. @@ -23,7 +22,7 @@ class ActivityProfileArgument extends ArgumentPluginBase { public function query($group_by = FALSE): void { $this->ensureMyTable(); - /** @var Sql $query */ + /** @var \Drupal\views\Plugin\views\query\Sql $query */ $query = $this->query; $query->addTable('activity__field_activity_recipient_user'); diff --git a/modules/custom/activity_viewer/src/Plugin/views/row/ActivityRow.php b/modules/custom/activity_viewer/src/Plugin/views/row/ActivityRow.php index 5841a89a189..5d5c9c1c912 100644 --- a/modules/custom/activity_viewer/src/Plugin/views/row/ActivityRow.php +++ b/modules/custom/activity_viewer/src/Plugin/views/row/ActivityRow.php @@ -37,15 +37,15 @@ class ActivityRow extends EntityRow { * The plugin id. * @param array $plugin_definition * The plugin definition. - * @param EntityTypeManagerInterface $entity_type_manager + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager. - * @param LanguageManagerInterface $language_manager + * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager * The language manager. - * @param EntityRepositoryInterface $entity_repository + * @param \Drupal\Core\Entity\EntityRepositoryInterface $entity_repository * The entity repository. - * @param EntityDisplayRepositoryInterface $entity_display_repository + * @param \Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository * The entity display repository. - * @param ActivityDestinationManager $activity_destination_manager + * @param \Drupal\activity_creator\Plugin\ActivityDestinationManager $activity_destination_manager * The activity destination manager. */ public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityTypeManagerInterface $entity_type_manager, LanguageManagerInterface $language_manager, EntityRepositoryInterface $entity_repository, EntityDisplayRepositoryInterface $entity_display_repository, ActivityDestinationManager $activity_destination_manager) { diff --git a/modules/custom/download_count/src/Plugin/Field/FieldFormatter/FieldDownloadCount.php b/modules/custom/download_count/src/Plugin/Field/FieldFormatter/FieldDownloadCount.php index c046141eb58..4ce93b9fa46 100644 --- a/modules/custom/download_count/src/Plugin/Field/FieldFormatter/FieldDownloadCount.php +++ b/modules/custom/download_count/src/Plugin/Field/FieldFormatter/FieldDownloadCount.php @@ -2,14 +2,12 @@ namespace Drupal\download_count\Plugin\Field\FieldFormatter; -use Drupal\Core\Field\EntityReferenceFieldItemListInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\File\FileUrlGenerator; use Drupal\Core\Session\AccountProxyInterface; use Drupal\Core\StringTranslation\ByteSizeMarkup; use Drupal\Core\Theme\ThemeManagerInterface; -use Drupal\file\FileInterface; use Drupal\file\IconMimeTypes; use Drupal\file\Plugin\Field\FieldFormatter\GenericFileFormatter; use Drupal\Core\Database\Database; @@ -116,7 +114,7 @@ public static function create(ContainerInterface $container, array $configuratio * {@inheritdoc} */ public function viewElements(FieldItemListInterface $items, $langcode): array { - /** @var EntityReferenceFieldItemListInterface $items */ + /** @var \Drupal\Core\Field\EntityReferenceFieldItemListInterface $items */ $element = []; $entity = $items->getEntity(); @@ -124,7 +122,7 @@ public function viewElements(FieldItemListInterface $items, $langcode): array { $access = $this->currentUser->hasPermission('view download counts'); $download = 0; - /** @var FileInterface $file */ + /** @var \Drupal\file\FileInterface $file */ foreach ($this->getEntitiesToView($items, $langcode) as $delta => $file) { $item = $file->_referringItem; @@ -136,7 +134,7 @@ public function viewElements(FieldItemListInterface $items, $langcode): array { ':type' => $entity_type, ':id' => $entity->id(), ]); - If ($result !== NULL) { + if ($result !== NULL) { $download = $result->fetchField(); $file->download = (int) $download; } diff --git a/modules/custom/dropdown/src/Element/Dropdown.php b/modules/custom/dropdown/src/Element/Dropdown.php index fa994d3a1d7..9d62f3d711b 100755 --- a/modules/custom/dropdown/src/Element/Dropdown.php +++ b/modules/custom/dropdown/src/Element/Dropdown.php @@ -37,7 +37,7 @@ public function getInfo(): array { /** * Prepare the render array for the template. */ - public static function preRenderDropdown(array $element): array { + public static function preRenderDropdown(array $element): array { // @todo Attach $element['#attached']['library'][] = 'dropdown'; return $element; } diff --git a/modules/custom/dropdown/src/Plugin/Field/FieldWidget/DropdownWidgetType.php b/modules/custom/dropdown/src/Plugin/Field/FieldWidget/DropdownWidgetType.php index c1381686ed0..479bda83d65 100644 --- a/modules/custom/dropdown/src/Plugin/Field/FieldWidget/DropdownWidgetType.php +++ b/modules/custom/dropdown/src/Plugin/Field/FieldWidget/DropdownWidgetType.php @@ -62,7 +62,7 @@ public function __construct($plugin_id, $plugin_definition, FieldDefinitionInter /** * {@inheritdoc} */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): self{ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): self { return new static( $plugin_id, $plugin_definition, diff --git a/modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php b/modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php index 043dbbed1be..9652de02e09 100644 --- a/modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php +++ b/modules/custom/entity_access_by_field/src/EntityAccessByFieldPermissions.php @@ -3,7 +3,6 @@ namespace Drupal\entity_access_by_field; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; -use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\EntityFieldManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; diff --git a/modules/custom/entity_access_by_field/src/Plugin/search_api/processor/EntityAccessByField.php b/modules/custom/entity_access_by_field/src/Plugin/search_api/processor/EntityAccessByField.php index 4bfc3484c82..49dffc47c30 100644 --- a/modules/custom/entity_access_by_field/src/Plugin/search_api/processor/EntityAccessByField.php +++ b/modules/custom/entity_access_by_field/src/Plugin/search_api/processor/EntityAccessByField.php @@ -2,8 +2,8 @@ namespace Drupal\entity_access_by_field\Plugin\search_api\processor; +use Drupal\group\Entity\Storage\GroupRelationshipStorageInterface; use Drupal\Core\Session\AnonymousUserSession; -use Drupal\Core\TypedData\ComplexDataInterface; use Drupal\search_api\Item\ItemInterface; use Drupal\search_api\LoggerTrait; use Drupal\search_api\Plugin\search_api\processor\ContentAccess; @@ -46,7 +46,7 @@ class EntityAccessByField extends ContentAccess { * * @var \Drupal\group\Entity\Storage\GroupRelationshipStorageInterface */ - protected \Drupal\group\Entity\Storage\GroupRelationshipStorageInterface $groupRelationshipStorage; + protected GroupRelationshipStorageInterface $groupRelationshipStorage; /** * {@inheritdoc} @@ -84,7 +84,7 @@ public function addFieldValues(ItemInterface $item): void { } // Get the node object. - /** @var ComplexDataInterface $original_object */ + /** @var \Drupal\Core\TypedData\ComplexDataInterface $original_object */ $original_object = $item->getOriginalObject(); $node = $this->getNode($original_object); if (!$node) { diff --git a/modules/custom/entity_access_by_field/tests/src/Unit/EntityAccessTest.php b/modules/custom/entity_access_by_field/tests/src/Unit/EntityAccessTest.php index d3bda7ad664..5eaf5adc1ce 100644 --- a/modules/custom/entity_access_by_field/tests/src/Unit/EntityAccessTest.php +++ b/modules/custom/entity_access_by_field/tests/src/Unit/EntityAccessTest.php @@ -1,5 +1,5 @@ t("Are you sure you want to request membership the group @group", ['@group' => $this->group?->label()]); } diff --git a/modules/custom/grequest/src/Form/GroupRequestMembershipRejectForm.php b/modules/custom/grequest/src/Form/GroupRequestMembershipRejectForm.php index 424c462c2c3..7d795b0073f 100644 --- a/modules/custom/grequest/src/Form/GroupRequestMembershipRejectForm.php +++ b/modules/custom/grequest/src/Form/GroupRequestMembershipRejectForm.php @@ -2,6 +2,7 @@ namespace Drupal\grequest\Form; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Form\ConfirmFormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; @@ -38,7 +39,7 @@ public function getFormId(): string { /** * {@inheritdoc} */ - public function getQuestion(): \Drupal\Core\StringTranslation\TranslatableMarkup { + public function getQuestion(): TranslatableMarkup { return $this->t('Are you sure you want to Reject this request?'); } diff --git a/modules/custom/group_core_comments/group_core_comments.module b/modules/custom/group_core_comments/group_core_comments.module index 690b7095d72..3a667085f8f 100644 --- a/modules/custom/group_core_comments/group_core_comments.module +++ b/modules/custom/group_core_comments/group_core_comments.module @@ -1,12 +1,12 @@ [ 'variables' => [ diff --git a/modules/custom/group_core_comments/src/Plugin/Field/FieldFormatter/CommentGroupContentFormatter.php b/modules/custom/group_core_comments/src/Plugin/Field/FieldFormatter/CommentGroupContentFormatter.php index 87bbbe69337..e1b0e026179 100644 --- a/modules/custom/group_core_comments/src/Plugin/Field/FieldFormatter/CommentGroupContentFormatter.php +++ b/modules/custom/group_core_comments/src/Plugin/Field/FieldFormatter/CommentGroupContentFormatter.php @@ -5,7 +5,6 @@ use Drupal\comment\Plugin\Field\FieldFormatter\CommentDefaultFormatter; use Drupal\Core\Access\AccessResult; use Drupal\Core\Access\AccessResultInterface; -use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\EntityDisplayRepositoryInterface; use Drupal\Core\Entity\EntityFormBuilderInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; @@ -17,7 +16,6 @@ use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; use Drupal\group\Entity\GroupRelationship; -use Drupal\group\Entity\GroupRelationshipInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -146,7 +144,7 @@ public function viewElements(FieldItemListInterface $items, $langcode): array { // Exclude entities without the set id. if (!empty($entity->id())) { - /** @var ContentEntityInterface[] $group_contents */ + /** @var \Drupal\Core\Entity\ContentEntityInterface[] $group_contents */ $group_contents = GroupRelationship::loadByEntity($entity); } @@ -156,7 +154,7 @@ public function viewElements(FieldItemListInterface $items, $langcode): array { $output['#cache']['contexts'][] = 'user.group_permissions'; $account = $this->currentUser; - /** @var GroupRelationshipInterface $group_content */ + /** @var \Drupal\group\Entity\GroupRelationshipInterface $group_content */ $group_content = reset($group_contents); $group = $group_content->getGroup(); $group_url = $group->toUrl('canonical', ['language' => $group->language()]); @@ -295,7 +293,7 @@ public function viewElements(FieldItemListInterface $items, $langcode): array { */ protected function getPermissionInGroups(string $perm, AccountInterface $account, array $group_contents, array &$output): AccessResultInterface { foreach ($group_contents as $group_content) { - /** @var GroupRelationshipInterface $group_content */ + /** @var \Drupal\group\Entity\GroupRelationshipInterface $group_content */ $group = $group_content->getGroup(); // Add cacheable dependency. diff --git a/modules/custom/mentions/src/EventSubscriber/MentionsDelete.php b/modules/custom/mentions/src/EventSubscriber/MentionsDelete.php index a432d59fb87..2c462b92ff2 100644 --- a/modules/custom/mentions/src/EventSubscriber/MentionsDelete.php +++ b/modules/custom/mentions/src/EventSubscriber/MentionsDelete.php @@ -4,7 +4,6 @@ use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\system\Entity\Action; use Symfony\Contracts\EventDispatcher\Event; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -60,7 +59,7 @@ public function onMentionsDelete(Event $event): void { return; } $entity_storage = $this->entityTypeManager->getStorage('action'); - /** @var Action|NULL $action */ + /** @var \Drupal\system\Entity\Action|NULL $action */ $action = $entity_storage->load($action_id); if ($action === NULL) { diff --git a/modules/custom/mentions/src/EventSubscriber/MentionsInsert.php b/modules/custom/mentions/src/EventSubscriber/MentionsInsert.php index f09cc6f978e..437ee81bc41 100644 --- a/modules/custom/mentions/src/EventSubscriber/MentionsInsert.php +++ b/modules/custom/mentions/src/EventSubscriber/MentionsInsert.php @@ -4,7 +4,6 @@ use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\system\Entity\Action; use Symfony\Contracts\EventDispatcher\Event; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -59,7 +58,7 @@ public function onMentionsInsert(Event $event): void { return; } $entity_storage = $this->entityTypeManager->getStorage('action'); - /** @var Action|NULL $action */ + /** @var \Drupal\system\Entity\Action|NULL $action */ $action = $entity_storage->load($action_id); if ($action === NULL) { diff --git a/modules/custom/mentions/src/EventSubscriber/MentionsUpdate.php b/modules/custom/mentions/src/EventSubscriber/MentionsUpdate.php index 20cd0f7d082..773679e23c7 100644 --- a/modules/custom/mentions/src/EventSubscriber/MentionsUpdate.php +++ b/modules/custom/mentions/src/EventSubscriber/MentionsUpdate.php @@ -4,7 +4,6 @@ use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\system\Entity\Action; use Symfony\Contracts\EventDispatcher\Event; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -60,7 +59,7 @@ public function onMentionsUpdate(Event $event): void { return; } $entity_storage = $this->entityTypeManager->getStorage('action'); - /** @var Action|NULL $action */ + /** @var \Drupal\system\Entity\Action|NULL $action */ $action = $entity_storage->load($action_id); if ($action === NULL) { diff --git a/modules/custom/mentions/src/Form/MentionsTypeForm.php b/modules/custom/mentions/src/Form/MentionsTypeForm.php index 3e41921fdf1..507d017f228 100644 --- a/modules/custom/mentions/src/Form/MentionsTypeForm.php +++ b/modules/custom/mentions/src/Form/MentionsTypeForm.php @@ -9,7 +9,6 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\StringTranslation\TranslatableMarkup; use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Form\ConfigFormBaseTrait; use Drupal\mentions\MentionsPluginManager; use Drupal\Core\Entity\ContentEntityType; diff --git a/modules/custom/social_font/src/Entity/Font.php b/modules/custom/social_font/src/Entity/Font.php index b1b323a33bb..b717d1c3ce0 100644 --- a/modules/custom/social_font/src/Entity/Font.php +++ b/modules/custom/social_font/src/Entity/Font.php @@ -2,6 +2,7 @@ namespace Drupal\social_font\Entity; +use Drupal\user\EntityOwnerInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Entity\ContentEntityBase; @@ -114,7 +115,7 @@ public function getOwnerId(): ?int { /** * {@inheritdoc} */ - public function setOwnerId($uid): \Drupal\user\EntityOwnerInterface|Font|static { + public function setOwnerId($uid): EntityOwnerInterface|Font|static { $this->set('user_id', $uid); return $this; } @@ -122,7 +123,7 @@ public function setOwnerId($uid): \Drupal\user\EntityOwnerInterface|Font|static /** * {@inheritdoc} */ - public function setOwner(UserInterface $account): \Drupal\user\EntityOwnerInterface|Font|static { + public function setOwner(UserInterface $account): EntityOwnerInterface|Font|static { $this->set('user_id', $account->id()); return $this; } diff --git a/modules/custom/social_font/src/FontHtmlRouteProvider.php b/modules/custom/social_font/src/FontHtmlRouteProvider.php index bb05775df7b..8e3b0871e6c 100644 --- a/modules/custom/social_font/src/FontHtmlRouteProvider.php +++ b/modules/custom/social_font/src/FontHtmlRouteProvider.php @@ -2,6 +2,7 @@ namespace Drupal\social_font; +use Symfony\Component\Routing\RouteCollection; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\Routing\AdminHtmlRouteProvider; use Symfony\Component\Routing\Route; @@ -18,7 +19,7 @@ class FontHtmlRouteProvider extends AdminHtmlRouteProvider { /** * {@inheritdoc} */ - public function getRoutes(EntityTypeInterface $entity_type): array|\Symfony\Component\Routing\RouteCollection { + public function getRoutes(EntityTypeInterface $entity_type): array|RouteCollection { $collection = parent::getRoutes($entity_type); $entity_type_id = $entity_type->id(); diff --git a/modules/custom/social_font/src/Form/FontForm.php b/modules/custom/social_font/src/Form/FontForm.php index bc3f5909c9d..7d10813208f 100644 --- a/modules/custom/social_font/src/Form/FontForm.php +++ b/modules/custom/social_font/src/Form/FontForm.php @@ -12,13 +12,6 @@ */ class FontForm extends ContentEntityForm { - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state): array { - return parent::buildForm($form, $form_state); - } - /** * {@inheritdoc} */ diff --git a/modules/custom/social_graphql/src/GraphQL/EntityConnection.php b/modules/custom/social_graphql/src/GraphQL/EntityConnection.php index 66172fb6c21..3b94446c951 100644 --- a/modules/custom/social_graphql/src/GraphQL/EntityConnection.php +++ b/modules/custom/social_graphql/src/GraphQL/EntityConnection.php @@ -4,7 +4,6 @@ namespace Drupal\social_graphql\GraphQL; -use Drupal\Core\Entity\Query\QueryAggregateInterface; use Drupal\social_graphql\Wrappers\EdgeInterface; use GraphQL\Error\UserError; use GraphQL\Executor\Promise\Adapter\SyncPromise; @@ -211,7 +210,7 @@ protected function hasResult() : bool { * * Multiple calls to this function return the same promise. * - * @return \GraphQL\Executor\Promise\Adapter\SyncPromise|NULL + * @return \GraphQL\Executor\Promise\Adapter\SyncPromise|null * The result for this connection's query. */ protected function getResult() : ?SyncPromise { @@ -281,7 +280,7 @@ protected function execute() : SyncPromise { $query->range(0, $limit + 1); if ($function = $this->queryHelper->getAggregateSortFunction()) { - /** @var QueryAggregateInterface $query */ + /** @var \Drupal\Core\Entity\Query\QueryAggregateInterface $query */ $query->sortAggregate( $sort_field, $function, diff --git a/modules/custom/social_graphql/src/Plugin/GraphQL/Schema/OpenSocialBaseSchema.php b/modules/custom/social_graphql/src/Plugin/GraphQL/Schema/OpenSocialBaseSchema.php index ae8211cd678..e6cd158df0e 100644 --- a/modules/custom/social_graphql/src/Plugin/GraphQL/Schema/OpenSocialBaseSchema.php +++ b/modules/custom/social_graphql/src/Plugin/GraphQL/Schema/OpenSocialBaseSchema.php @@ -2,6 +2,7 @@ namespace Drupal\social_graphql\Plugin\GraphQL\Schema; +use GraphQL\Type\Schema; use Drupal\graphql\GraphQL\ResolverBuilder; use Drupal\graphql\GraphQL\ResolverRegistryInterface; use Drupal\graphql\Plugin\GraphQL\Schema\SdlSchemaPluginBase; @@ -41,7 +42,7 @@ public function getResolverRegistry(): ResolverRegistry|ResolverRegistryInterfac /** * {@inheritdoc} */ - public function getSchema(ResolverRegistryInterface $registry): \GraphQL\Type\Schema { + public function getSchema(ResolverRegistryInterface $registry): Schema { // Add Open Social base types to the schema. $this->getBaseSchema($registry); diff --git a/modules/custom/social_graphql/src/Wrappers/EdgeInterface.php b/modules/custom/social_graphql/src/Wrappers/EdgeInterface.php index cfbc59cf380..625e16129b6 100644 --- a/modules/custom/social_graphql/src/Wrappers/EdgeInterface.php +++ b/modules/custom/social_graphql/src/Wrappers/EdgeInterface.php @@ -2,8 +2,6 @@ namespace Drupal\social_graphql\Wrappers; -use Drupal\node\NodeInterface; - /** * Provides a common interface for edges that DataProducers can work with. */ diff --git a/modules/custom/social_language/social_language.module b/modules/custom/social_language/social_language.module index 7b30aabc03a..81bf343bac1 100644 --- a/modules/custom/social_language/social_language.module +++ b/modules/custom/social_language/social_language.module @@ -88,7 +88,7 @@ function social_language_entity_operation_alter(array &$operations, EntityInterf /** * Implements hook_field_group_form_process_alter(). */ -function social_language_field_group_form_process_alter(array &$element, mixed &$group, array &$complete_form): void { +function social_language_field_group_form_process_alter(array &$element, mixed &$group, array &$complete_form): void { // Prevent \Drupal\content_translation\ContentTranslationHandler::addTranslatabilityClue() // from adding an incorrect suffix to the field group title. $element['#multilingual'] = TRUE; diff --git a/modules/custom/social_language/src/Plugin/UserExportPlugin/UserLanguage.php b/modules/custom/social_language/src/Plugin/UserExportPlugin/UserLanguage.php index 968678d20fd..b4585faee7f 100644 --- a/modules/custom/social_language/src/Plugin/UserExportPlugin/UserLanguage.php +++ b/modules/custom/social_language/src/Plugin/UserExportPlugin/UserLanguage.php @@ -2,6 +2,7 @@ namespace Drupal\social_language\Plugin\UserExportPlugin; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Database\Connection; use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; @@ -55,7 +56,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition /** * The create method. * - * @param ContainerInterface $container + * @param \Symfony\Component\DependencyInjection\ContainerInterface $container * Container interface. * @param array $configuration * An array of configuration. @@ -82,7 +83,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function getHeader(): string|\Drupal\Core\StringTranslation\TranslatableMarkup { + public function getHeader(): string|TranslatableMarkup { return $this->t('Language'); } diff --git a/modules/custom/social_language/src/SocialLanguageServiceProvider.php b/modules/custom/social_language/src/SocialLanguageServiceProvider.php index 4c9568982cc..4b368d9733e 100644 --- a/modules/custom/social_language/src/SocialLanguageServiceProvider.php +++ b/modules/custom/social_language/src/SocialLanguageServiceProvider.php @@ -4,7 +4,6 @@ use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ServiceProviderBase; -use Drupal\social_language\SocialLanguageModalRenderer; /** * Class SocialLanguageServiceProvider. diff --git a/modules/custom/social_lazy_loading/src/SocialLazyLoadingTextFormatOverride.php b/modules/custom/social_lazy_loading/src/SocialLazyLoadingTextFormatOverride.php index 3c62a495ab8..f455cde50fa 100644 --- a/modules/custom/social_lazy_loading/src/SocialLazyLoadingTextFormatOverride.php +++ b/modules/custom/social_lazy_loading/src/SocialLazyLoadingTextFormatOverride.php @@ -2,6 +2,7 @@ namespace Drupal\social_lazy_loading; +use Drupal\Core\Config\StorableConfigBase; use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Config\ConfigFactoryOverrideInterface; use Drupal\Core\Config\StorageInterface; @@ -95,7 +96,7 @@ public function getCacheableMetadata($name): CacheableMetadata { /** * {@inheritdoc} */ - public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION): ?\Drupal\Core\Config\StorableConfigBase { + public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION): ?StorableConfigBase { return NULL; } diff --git a/modules/custom/social_metatag/social_metatag.module b/modules/custom/social_metatag/social_metatag.module index 09d10ae4325..cafc4652601 100644 --- a/modules/custom/social_metatag/social_metatag.module +++ b/modules/custom/social_metatag/social_metatag.module @@ -5,6 +5,7 @@ * The Social metatag module. */ +use Drupal\Core\Entity\EntityInterface; use Drupal\node\Entity\Node; use Drupal\Core\Routing\RouteMatchInterface; @@ -20,7 +21,7 @@ use Drupal\Core\Routing\RouteMatchInterface; * @return \Drupal\Core\Entity\EntityInterface|null * Return an entity, if the route should use metatags. */ -function social_metatag_metatag_route_entity(RouteMatchInterface $route_match): ?\Drupal\Core\Entity\EntityInterface { +function social_metatag_metatag_route_entity(RouteMatchInterface $route_match): ?EntityInterface { // Metatag_views will override all the views Metatags with defaults. // if it's not enabled we can continue to provide Group & Events to the tabs // which are basically views metatags but now coming from Entity defaults. diff --git a/modules/custom/social_path_manager/social_path_manager.module b/modules/custom/social_path_manager/social_path_manager.module index e20474622a6..8b303d50145 100644 --- a/modules/custom/social_path_manager/social_path_manager.module +++ b/modules/custom/social_path_manager/social_path_manager.module @@ -53,7 +53,7 @@ function social_path_manager_form_alter(array &$form, FormStateInterface $form_s return; } $entity = $form_object->getEntity(); - if( $entity instanceof ContentEntityInterface) { + if ($entity instanceof ContentEntityInterface) { $form['#validate'][] = "_social_path_manager_path_alias_validate"; } } diff --git a/modules/custom/social_queue_storage/src/Entity/QueueStorageEntity.php b/modules/custom/social_queue_storage/src/Entity/QueueStorageEntity.php index db4044ad760..09562ee65ab 100644 --- a/modules/custom/social_queue_storage/src/Entity/QueueStorageEntity.php +++ b/modules/custom/social_queue_storage/src/Entity/QueueStorageEntity.php @@ -2,6 +2,7 @@ namespace Drupal\social_queue_storage\Entity; +use Drupal\user\EntityOwnerInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Entity\ContentEntityBase; @@ -117,7 +118,7 @@ public function setCreatedTime($timestamp): QueueStorageEntityInterface|static { * {@inheritdoc} */ public function getOwner(): UserInterface { - /** @var UserInterface $user */ + /** @var \Drupal\user\UserInterface $user */ $user = $this->get('user_id')->entity; return $user; } @@ -132,7 +133,7 @@ public function getOwnerId(): ?int { /** * {@inheritdoc} */ - public function setOwnerId($uid): QueueStorageEntity|\Drupal\user\EntityOwnerInterface|static { + public function setOwnerId($uid): QueueStorageEntity|EntityOwnerInterface|static { $this->set('user_id', $uid); return $this; } @@ -140,7 +141,7 @@ public function setOwnerId($uid): QueueStorageEntity|\Drupal\user\EntityOwnerInt /** * {@inheritdoc} */ - public function setOwner(UserInterface $account): QueueStorageEntity|\Drupal\user\EntityOwnerInterface|static { + public function setOwner(UserInterface $account): QueueStorageEntity|EntityOwnerInterface|static { $this->set('user_id', $account->id()); return $this; } @@ -148,7 +149,6 @@ public function setOwner(UserInterface $account): QueueStorageEntity|\Drupal\use /** * {@inheritdoc} */ - public function isFinished(): bool { return (bool) $this->get('finished')->value; } diff --git a/modules/custom/social_queue_storage/src/Form/QueueStorageEntityForm.php b/modules/custom/social_queue_storage/src/Form/QueueStorageEntityForm.php index f779d1490dc..27200f9348d 100644 --- a/modules/custom/social_queue_storage/src/Form/QueueStorageEntityForm.php +++ b/modules/custom/social_queue_storage/src/Form/QueueStorageEntityForm.php @@ -30,13 +30,6 @@ public static function create(ContainerInterface $container): self { return $instance; } - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state): array { - return parent::buildForm($form, $form_state); - } - /** * {@inheritdoc} */ @@ -62,4 +55,5 @@ public function save(array $form, FormStateInterface $form_state): int { $form_state->setRedirect('entity.queue_storage_entity.canonical', ['queue_storage_entity' => $entity->id()]); return 0; } + } diff --git a/modules/custom/social_queue_storage/src/QueueStorageEntityHtmlRouteProvider.php b/modules/custom/social_queue_storage/src/QueueStorageEntityHtmlRouteProvider.php index 7529fea6ad4..a2cdc11f814 100644 --- a/modules/custom/social_queue_storage/src/QueueStorageEntityHtmlRouteProvider.php +++ b/modules/custom/social_queue_storage/src/QueueStorageEntityHtmlRouteProvider.php @@ -2,6 +2,7 @@ namespace Drupal\social_queue_storage; +use Symfony\Component\Routing\RouteCollection; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\Routing\AdminHtmlRouteProvider; use Symfony\Component\Routing\Route; @@ -18,7 +19,7 @@ class QueueStorageEntityHtmlRouteProvider extends AdminHtmlRouteProvider { /** * {@inheritdoc} */ - public function getRoutes(EntityTypeInterface $entity_type): array|\Symfony\Component\Routing\RouteCollection { + public function getRoutes(EntityTypeInterface $entity_type): array|RouteCollection { $collection = parent::getRoutes($entity_type); $entity_type_id = $entity_type->id(); @@ -47,7 +48,7 @@ protected function getSettingsFormRoute(EntityTypeInterface $entity_type): ?Rout '_form' => QueueStorageEntitySettingsForm::class, '_title' => "{$entity_type->getLabel()} settings", ]) - ->setRequirement('_permission', (string) $entity_type->getAdminPermission()) + ->setRequirement('_permission', (string) $entity_type->getAdminPermission()) ->setOption('_admin_route', TRUE); return $route; diff --git a/modules/custom/template_suggestions_extra/template_suggestions_extra.module b/modules/custom/template_suggestions_extra/template_suggestions_extra.module index be520f04b55..1b9c9f516d3 100644 --- a/modules/custom/template_suggestions_extra/template_suggestions_extra.module +++ b/modules/custom/template_suggestions_extra/template_suggestions_extra.module @@ -5,6 +5,7 @@ * Contains template_suggestions_extra.module.. */ +use Drupal\node\NodeInterface; use Drupal\Core\Routing\RouteMatchInterface; /** @@ -34,7 +35,7 @@ function template_suggestions_extra_theme_suggestions_page_alter(array &$suggest $node = \Drupal::service('entity_type.manager')->getStorage('node')->load($node); } - if (isset($node) && $node instanceof \Drupal\node\NodeInterface) { + if (isset($node) && $node instanceof NodeInterface) { $altered_suggestions = []; foreach ($suggestions as $suggestion) { diff --git a/modules/social_features/social_activity/modules/social_activity_filter/src/Form/FilterSettingsForm.php b/modules/social_features/social_activity/modules/social_activity_filter/src/Form/FilterSettingsForm.php index 8328326fc6c..a7910f0a7c1 100755 --- a/modules/social_features/social_activity/modules/social_activity_filter/src/Form/FilterSettingsForm.php +++ b/modules/social_features/social_activity/modules/social_activity_filter/src/Form/FilterSettingsForm.php @@ -3,13 +3,11 @@ namespace Drupal\social_activity_filter\Form; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Entity\EntityFieldManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Updater\Module; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/modules/social_features/social_activity/modules/social_activity_filter/src/Plugin/views/filter/ActivityFilterTags.php b/modules/social_features/social_activity/modules/social_activity_filter/src/Plugin/views/filter/ActivityFilterTags.php index b4a29791534..bd42e385be7 100755 --- a/modules/social_features/social_activity/modules/social_activity_filter/src/Plugin/views/filter/ActivityFilterTags.php +++ b/modules/social_features/social_activity/modules/social_activity_filter/src/Plugin/views/filter/ActivityFilterTags.php @@ -5,7 +5,6 @@ use Drupal\Core\Database\Connection; use Drupal\Core\Database\Query\Condition; use Drupal\views\Plugin\views\filter\FilterPluginBase; -use Drupal\views\Plugin\views\query\Sql; use Drupal\views\Views; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -69,7 +68,7 @@ public function query(): void { $taxonomy_post_table = "post__field_{$taxonomy_field}"; $activity_entity_table = 'activity__field_activity_entity'; - /** @var Sql $query */ + /** @var \Drupal\views\Plugin\views\query\Sql $query */ $query = $this->query; // Filter Nodes by selected tags. diff --git a/modules/social_features/social_activity/src/EmailTokenServices.php b/modules/social_features/social_activity/src/EmailTokenServices.php index 8c2bf32bc60..3bd3fff0284 100644 --- a/modules/social_features/social_activity/src/EmailTokenServices.php +++ b/modules/social_features/social_activity/src/EmailTokenServices.php @@ -2,12 +2,10 @@ namespace Drupal\social_activity; +use Drupal\Core\Entity\EntityInterface; use Drupal\comment\Entity\Comment; -use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException; -use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Datetime\DateFormatter; -use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; @@ -115,16 +113,16 @@ public function __construct( /** * Loads the related object from a given message entity. * - * @param Message $message + * @param \Drupal\message\Entity\Message $message * The message entity. * - * @return EntityInterface|null + * @return \Drupal\Core\Entity\EntityInterface|null * An entity object. NULL if no matching entity is found. * * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ - public function getRelatedObject(Message $message): ?\Drupal\Core\Entity\EntityInterface { + public function getRelatedObject(Message $message): ?EntityInterface { if ($message->get('field_message_related_object')->isEmpty()) { return NULL; } diff --git a/modules/social_features/social_activity/src/Plugin/views/display/ModeBlock.php b/modules/social_features/social_activity/src/Plugin/views/display/ModeBlock.php index 6db199c880f..a2af859b7bb 100755 --- a/modules/social_features/social_activity/src/Plugin/views/display/ModeBlock.php +++ b/modules/social_features/social_activity/src/Plugin/views/display/ModeBlock.php @@ -165,8 +165,7 @@ public function preBlockBuild(ViewsBlock $block): void { $block_configuration = $block->getConfiguration(); if (isset($block_configuration['type'])) { - $type_filter = $this->view->filter['type']; - $type_filter->value = $block_configuration['type']; + $this->view->filter_type = $block_configuration['type']; } } diff --git a/modules/social_features/social_activity/src/SocialActivityLazyBuilder.php b/modules/social_features/social_activity/src/SocialActivityLazyBuilder.php index 1fb872559ea..b9d57a04770 100644 --- a/modules/social_features/social_activity/src/SocialActivityLazyBuilder.php +++ b/modules/social_features/social_activity/src/SocialActivityLazyBuilder.php @@ -4,7 +4,6 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Security\TrustedCallbackInterface; -use Drupal\views\ViewEntityInterface; use Drupal\views\ViewExecutableFactory; /** @@ -69,7 +68,7 @@ public static function trustedCallbacks(): array { */ public function viewsLazyBuild(string $view_id, string $display_id, string $node_type, int $item_per_page, ?string $vocabulary = NULL, ...$tags): ?array { // Get view. - /** @var ViewEntityInterface $view_entity */ + /** @var \Drupal\views\ViewEntityInterface $view_entity */ $view_entity = $this->entityTypeManager->getStorage('view')->load($view_id); $view = $this->viewExecutable->get($view_entity); $view->setDisplay($display_id); diff --git a/modules/social_features/social_album/social_album.install b/modules/social_features/social_album/social_album.install index 15e4366953b..b16de9c0e24 100644 --- a/modules/social_features/social_album/social_album.install +++ b/modules/social_features/social_album/social_album.install @@ -121,7 +121,7 @@ function _social_album_set_group_permissions(): void { if (!is_array($execute)) { return; } - foreach ($execute as $type_id) { + foreach ($execute as $type_id) { /** @var \Drupal\group\Entity\GroupTypeInterface $type */ $type = $type_storage->load($type_id); diff --git a/modules/social_features/social_album/src/Controller/SocialAlbumController.php b/modules/social_features/social_album/src/Controller/SocialAlbumController.php index 5bb85acbc6f..0795f55fb23 100644 --- a/modules/social_features/social_album/src/Controller/SocialAlbumController.php +++ b/modules/social_features/social_album/src/Controller/SocialAlbumController.php @@ -2,6 +2,7 @@ namespace Drupal\social_album\Controller; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Access\AccessResult; use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\Config\ConfigFactoryInterface; @@ -111,16 +112,16 @@ public static function create(ContainerInterface $container): self { * @return \Drupal\Core\StringTranslation\TranslatableMarkup * The title to page of the post. */ - public function title(NodeInterface $node): \Drupal\Core\StringTranslation\TranslatableMarkup { + public function title(NodeInterface $node): TranslatableMarkup { return $this->t('Add images to album @name', ['@name' => $node->label()]); } /** * Provides a page with images slider. * - * @param NodeInterface $node + * @param \Drupal\node\NodeInterface $node * The node object. - * @param PostInterface $post + * @param \Drupal\social_post\Entity\PostInterface $post * The post entity object. * @param int $fid * The file entity ID. @@ -152,7 +153,7 @@ public function viewImage(NodeInterface $node, PostInterface $post, int $fid): a $storage = $this->entityTypeManager()->getStorage('file'); $result = $query->execute(); - if ($result === NULL){ + if ($result === NULL) { return []; } @@ -239,10 +240,10 @@ protected function checkAlbumAccess(NodeInterface $node): bool { /** * Checks access to the page for adding an image to an album. * - * @param NodeInterface $node + * @param \Drupal\node\NodeInterface $node * The node entity object. * - * @return AccessResultInterface + * @return \Drupal\Core\Access\AccessResultInterface * The access result. * * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException diff --git a/modules/social_features/social_album/src/Form/SocialAlbumImageForm.php b/modules/social_features/social_album/src/Form/SocialAlbumImageForm.php index d0487746a1d..baf16fb3576 100644 --- a/modules/social_features/social_album/src/Form/SocialAlbumImageForm.php +++ b/modules/social_features/social_album/src/Form/SocialAlbumImageForm.php @@ -2,6 +2,7 @@ namespace Drupal\social_album\Form; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Form\FormStateInterface; use Drupal\social_post\Form\PostDeleteForm; @@ -58,7 +59,7 @@ public function submitForm(array &$form, FormStateInterface $form_state): void { /** * {@inheritdoc} */ - public function getDescription(): \Drupal\Core\StringTranslation\TranslatableMarkup { + public function getDescription(): TranslatableMarkup { return $this->t('Deleting this image will also delete it from the post it belongs to.'); } diff --git a/modules/social_features/social_album/src/Plugin/Field/FieldWidget/SocialAlbumOptionsSelectWidget.php b/modules/social_features/social_album/src/Plugin/Field/FieldWidget/SocialAlbumOptionsSelectWidget.php index 7af4ef0e816..e121e9fd87f 100644 --- a/modules/social_features/social_album/src/Plugin/Field/FieldWidget/SocialAlbumOptionsSelectWidget.php +++ b/modules/social_features/social_album/src/Plugin/Field/FieldWidget/SocialAlbumOptionsSelectWidget.php @@ -108,8 +108,8 @@ public static function validateElement(array $element, FormStateInterface $form_ $element['#value'] === '_add' && ($title = $form_state->getValue([$field, 'title'])) ) { - $triggerred_element = $form_state->getTriggeringElement(); - if (is_array($triggerred_element) && $triggerred_element['#name'] === 'op' && $has_images) { + $triggered_element = $form_state->getTriggeringElement(); + if (is_array($triggered_element) && $triggered_element['#name'] === 'op' && $has_images) { // Add default content visibility based on post visibility. if ($form_state->hasValue('field_visibility')) { $post_visibility = $form_state->getValue(['field_visibility', 0]); diff --git a/modules/social_features/social_album/src/Plugin/views/field/SocialAlbumEntityOperations.php b/modules/social_features/social_album/src/Plugin/views/field/SocialAlbumEntityOperations.php index ec906b16ae3..b0249ef72f5 100644 --- a/modules/social_features/social_album/src/Plugin/views/field/SocialAlbumEntityOperations.php +++ b/modules/social_features/social_album/src/Plugin/views/field/SocialAlbumEntityOperations.php @@ -2,6 +2,7 @@ namespace Drupal\social_album\Plugin\views\field; +use Drupal\Core\Field\FieldItemInterface; use Drupal\Component\Render\MarkupInterface; use Drupal\Core\Url; use Drupal\social_post\PostViewBuilder; @@ -40,7 +41,7 @@ public function render(ResultRow $values): MarkupInterface|array|string { $field_item = $entity->get('field_post_image')->get($value); $target_id = NULL; - if ($field_item instanceof \Drupal\Core\Field\FieldItemInterface && isset($field_item->target_id)) { + if ($field_item instanceof FieldItemInterface && isset($field_item->target_id)) { $target_id = $field_item->target_id; } diff --git a/modules/social_features/social_book/src/Plugin/Block/GroupAddBookBlock.php b/modules/social_features/social_book/src/Plugin/Block/GroupAddBookBlock.php index 0e788ae3907..3f0e816ffc0 100644 --- a/modules/social_features/social_book/src/Plugin/Block/GroupAddBookBlock.php +++ b/modules/social_features/social_book/src/Plugin/Block/GroupAddBookBlock.php @@ -2,6 +2,9 @@ namespace Drupal\social_book\Plugin\Block; +use Drupal\Core\Access\AccessResultInterface; +use Drupal\Core\Access\AccessResultAllowed; +use Drupal\Core\Access\AccessResultForbidden; use Drupal\Core\Block\BlockBase; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Extension\ModuleHandlerInterface; @@ -81,7 +84,7 @@ public function defaultConfiguration(): array { * * Custom access logic to display the block. */ - public function blockAccess(AccountInterface $account): \Drupal\Core\Access\AccessResultForbidden|\Drupal\Core\Access\AccessResultAllowed|\Drupal\Core\Access\AccessResultInterface { + public function blockAccess(AccountInterface $account): AccessResultForbidden|AccessResultAllowed|AccessResultInterface { if ($this->moduleHandler->moduleExists('social_group')) { $group = _social_group_get_current_group(); } diff --git a/modules/social_features/social_branding/src/Plugin/GraphQL/DataProducer/BrandingLogoUrl.php b/modules/social_features/social_branding/src/Plugin/GraphQL/DataProducer/BrandingLogoUrl.php index a8e38af3a2d..a4b6723301d 100644 --- a/modules/social_features/social_branding/src/Plugin/GraphQL/DataProducer/BrandingLogoUrl.php +++ b/modules/social_features/social_branding/src/Plugin/GraphQL/DataProducer/BrandingLogoUrl.php @@ -5,7 +5,6 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\ImmutableConfig; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\Core\StreamWrapper\StreamWrapperInterface; use Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -77,7 +76,7 @@ public function __construct(array $configuration, string $plugin_id, array $plug public function resolve(ImmutableConfig $community_branding) : ?string { if ($community_branding->get('default') === 'socialblue') { if ($this->config->get('socialblue.settings')->get('logo.path')) { - /** @var StreamWrapperInterface $wrapper */ + /** @var \Drupal\Core\StreamWrapper\StreamWrapperInterface $wrapper */ $wrapper = \Drupal::service('stream_wrapper_manager') ->getViaUri($this->config->get('socialblue.settings')->get('logo.path')); return $wrapper->getExternalUrl(); diff --git a/modules/social_features/social_comment/social_comment.module b/modules/social_features/social_comment/social_comment.module index 221e1fb5503..f1981433ed7 100644 --- a/modules/social_features/social_comment/social_comment.module +++ b/modules/social_features/social_comment/social_comment.module @@ -112,7 +112,7 @@ function social_comment_form_comment_form_alter(array &$form, FormStateInterface * * @param array $form * The form array. - * @param FormStateInterface $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The form state interface of the form. * * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException diff --git a/modules/social_features/social_comment/src/Controller/SocialCommentController.php b/modules/social_features/social_comment/src/Controller/SocialCommentController.php index 7b9f3f3f0bd..7d8c9cca055 100644 --- a/modules/social_features/social_comment/src/Controller/SocialCommentController.php +++ b/modules/social_features/social_comment/src/Controller/SocialCommentController.php @@ -2,8 +2,9 @@ namespace Drupal\social_comment\Controller; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\RedirectResponse; use Drupal\Core\Entity\EntityBase; -use Drupal\Core\Entity\EntityMalformedException; use Drupal\Core\Url; use Drupal\comment\CommentInterface; use Symfony\Component\HttpFoundation\Request; @@ -21,7 +22,7 @@ class SocialCommentController extends CommentController { * * @inheritdoc */ - public function commentPermalink(Request $request, CommentInterface $comment): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { + public function commentPermalink(Request $request, CommentInterface $comment): RedirectResponse|Response { if ($entity = $comment->getCommentedEntity()) { // Check access permissions for the entity. /** @var \Drupal\Core\Entity\EntityBase $entity */ @@ -41,15 +42,15 @@ public function commentPermalink(Request $request, CommentInterface $comment): \ * * @param \Drupal\Core\Url $url * The canonical url. - * @param \Drupal\comment\CommentInterface|NULL $comment + * @param \Drupal\comment\CommentInterface|null $comment * The comment interface. - * @param \Drupal\Core\Entity\EntityBase|NULL $entity + * @param \Drupal\Core\Entity\EntityBase|null $entity * The Entity to redirect to. * * @return \Symfony\Component\HttpFoundation\RedirectResponse * Returns the Redirect Response. */ - public function redirectToOriginalEntity(Url $url, CommentInterface $comment = NULL, EntityBase $entity = NULL): \Symfony\Component\HttpFoundation\RedirectResponse { + public function redirectToOriginalEntity(Url $url, CommentInterface $comment = NULL, EntityBase $entity = NULL): RedirectResponse { $options = []; if (isset($comment)) { $options = ['fragment' => 'comment-' . $comment->id()]; @@ -67,9 +68,9 @@ public function redirectToOriginalEntity(Url $url, CommentInterface $comment = N * Redirect to where. * * @throws \Drupal\Core\Entity\EntityStorageException - * @throws EntityMalformedException + * @throws \Drupal\Core\Entity\EntityMalformedException */ - public function commentUnpublish(CommentInterface $comment): \Symfony\Component\HttpFoundation\RedirectResponse { + public function commentUnpublish(CommentInterface $comment): RedirectResponse { $comment->setUnpublished(); $comment->save(); diff --git a/modules/social_features/social_comment/src/Form/SocialCommentAdminOverview.php b/modules/social_features/social_comment/src/Form/SocialCommentAdminOverview.php index 59d2905825c..ee7d0d29942 100644 --- a/modules/social_features/social_comment/src/Form/SocialCommentAdminOverview.php +++ b/modules/social_features/social_comment/src/Form/SocialCommentAdminOverview.php @@ -4,7 +4,6 @@ use Drupal\comment\CommentInterface; use Drupal\Core\Datetime\DateFormatterInterface; -use Drupal\Core\Entity\EntityMalformedException; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormBase; diff --git a/modules/social_features/social_comment/src/Plugin/GraphQL/DataProducer/QueryComments.php b/modules/social_features/social_comment/src/Plugin/GraphQL/DataProducer/QueryComments.php index ccf269714e4..e34ebc1ad0b 100644 --- a/modules/social_features/social_comment/src/Plugin/GraphQL/DataProducer/QueryComments.php +++ b/modules/social_features/social_comment/src/Plugin/GraphQL/DataProducer/QueryComments.php @@ -2,11 +2,9 @@ namespace Drupal\social_comment\Plugin\GraphQL\DataProducer; -use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException; -use Drupal\Component\Plugin\Exception\PluginNotFoundException; +use Drupal\social_graphql\GraphQL\ConnectionInterface; use Drupal\Core\Cache\RefinableCacheableDependencyInterface; use Drupal\node\NodeInterface; -use Drupal\social_graphql\GraphQL\ConnectionInterface; use Drupal\social_graphql\GraphQL\EntityConnection; use Drupal\social_graphql\Plugin\GraphQL\DataProducer\Entity\EntityDataProducerPluginBase; use Drupal\social_comment\Plugin\GraphQL\QueryHelper\CommentQueryHelper; @@ -64,7 +62,7 @@ class QueryComments extends EntityDataProducerPluginBase { /** * Resolves the request to the requested values. * - * @param NodeInterface|null $parent + * @param \Drupal\node\NodeInterface|null $parent * The comment parent entity or ID. * @param string|null $bundle * The comment bundle. @@ -80,22 +78,22 @@ class QueryComments extends EntityDataProducerPluginBase { * Reverses the order of the data. * @param string $sortKey * Key to sort by. - * @param RefinableCacheableDependencyInterface $metadata + * @param \Drupal\Core\Cache\RefinableCacheableDependencyInterface $metadata * Cacheability metadata for this request. * - * @return EntityConnection|ConnectionInterface + * @return \Drupal\social_graphql\GraphQL\EntityConnection|ConnectionInterface * An entity connection with results and data about the paginated results. * - * @throws InvalidPluginDefinitionException - * @throws PluginNotFoundException + * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException + * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ - public function resolve(?NodeInterface $parent, ?string $bundle, ?int $first, ?string $after, ?int $last, ?string $before, bool $reverse, string $sortKey, RefinableCacheableDependencyInterface $metadata): EntityConnection|\Drupal\social_graphql\GraphQL\ConnectionInterface { + public function resolve(?NodeInterface $parent, ?string $bundle, ?int $first, ?string $after, ?int $last, ?string $before, bool $reverse, string $sortKey, RefinableCacheableDependencyInterface $metadata): EntityConnection|ConnectionInterface { if ($parent) { $nodes = $this->entityTypeManager->getStorage('node')->loadByProperties(['uuid' => $parent->uuid()]); $parent = reset($nodes); } - /** @var NodeInterface $parent*/ + /** @var \Drupal\node\NodeInterface $parent*/ $query_helper = new CommentQueryHelper($sortKey, $this->entityTypeManager, $this->graphqlEntityBuffer, $parent, $bundle); $metadata->addCacheableDependency($query_helper); diff --git a/modules/social_features/social_comment/src/Plugin/GraphQL/DataProducer/SocialCommentAttachments.php b/modules/social_features/social_comment/src/Plugin/GraphQL/DataProducer/SocialCommentAttachments.php index eb920de053c..66d9f4325c1 100644 --- a/modules/social_features/social_comment/src/Plugin/GraphQL/DataProducer/SocialCommentAttachments.php +++ b/modules/social_features/social_comment/src/Plugin/GraphQL/DataProducer/SocialCommentAttachments.php @@ -2,6 +2,7 @@ namespace Drupal\social_comment\Plugin\GraphQL\DataProducer; +use Drupal\social_graphql\GraphQL\ConnectionInterface; use Drupal\Core\Cache\RefinableCacheableDependencyInterface; use Drupal\Core\Database\Connection; use Drupal\Core\Entity\EntityInterface; @@ -9,7 +10,6 @@ use Drupal\graphql\GraphQL\Buffers\EntityBuffer; use Drupal\graphql\GraphQL\Buffers\EntityRevisionBuffer; use Drupal\graphql\GraphQL\Buffers\EntityUuidBuffer; -use Drupal\social_graphql\GraphQL\ConnectionInterface; use Drupal\social_graphql\GraphQL\EntityConnection; use Drupal\social_graphql\Plugin\GraphQL\DataProducer\Entity\EntityDataProducerPluginBase; use Drupal\social_comment\Plugin\GraphQL\QueryHelper\CommentAttachmentsQueryHelper; @@ -69,9 +69,19 @@ class SocialCommentAttachments extends EntityDataProducerPluginBase { protected Connection $database; /** - * {@inheritdoc} + * The factory method to create an instance of this class. * - * @codeCoverageIgnore + * @param \Symfony\Component\DependencyInjection\ContainerInterface $container + * The container interface. + * @param array $configuration + * The configuration array. + * @param string $plugin_id + * The plugin id. + * @param string $plugin_definition + * The plugin definition. + * + * @return self + * Returns the instance of this class. */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): self { return new static( @@ -99,6 +109,12 @@ public static function create(ContainerInterface $container, array $configuratio * The entity type manager service. * @param \Drupal\Core\Database\Connection $database * Database Service Object. + * @param \Drupal\graphql\GraphQL\Buffers\EntityBuffer $graphqlEntityBuffer + * The entity buffer service. + * @param \Drupal\graphql\GraphQL\Buffers\EntityUuidBuffer $graphqlEntityUuidBuffer + * The entity uuid buffer service. + * @param \Drupal\graphql\GraphQL\Buffers\EntityRevisionBuffer $graphqlEntityRevisionBuffer + * The entity revision buffer service. * * @codeCoverageIgnore */ @@ -127,7 +143,7 @@ public function __construct( /** * Resolves the request to the requested values. * - * @param EntityInterface $parent + * @param \Drupal\Core\Entity\EntityInterface $parent * The conversation to fetch participants for. * @param int|null $first * Fetch the first X results. @@ -141,13 +157,13 @@ public function __construct( * Reverses the order of the data. * @param string $sortKey * Key to sort by. - * @param RefinableCacheableDependencyInterface $metadata + * @param \Drupal\Core\Cache\RefinableCacheableDependencyInterface $metadata * Cacheability metadata for this request. * - * @return EntityConnection|ConnectionInterface + * @return \Drupal\social_graphql\GraphQL\EntityConnection|ConnectionInterface * An entity connection with results and data about the paginated results. */ - public function resolve(EntityInterface $parent, ?int $first, ?string $after, ?int $last, ?string $before, bool $reverse, string $sortKey, RefinableCacheableDependencyInterface $metadata): EntityConnection|\Drupal\social_graphql\GraphQL\ConnectionInterface { + public function resolve(EntityInterface $parent, ?int $first, ?string $after, ?int $last, ?string $before, bool $reverse, string $sortKey, RefinableCacheableDependencyInterface $metadata): EntityConnection|ConnectionInterface { $query_helper = new CommentAttachmentsQueryHelper($sortKey, $this->entityTypeManager, $this->graphqlEntityBuffer, $this->database, $parent); $metadata->addCacheableDependency($query_helper); diff --git a/modules/social_features/social_comment_upload/src/Form/SocialCommentUploadSettingsForm.php b/modules/social_features/social_comment_upload/src/Form/SocialCommentUploadSettingsForm.php index c402d475383..e1659e5b1a6 100644 --- a/modules/social_features/social_comment_upload/src/Form/SocialCommentUploadSettingsForm.php +++ b/modules/social_features/social_comment_upload/src/Form/SocialCommentUploadSettingsForm.php @@ -2,8 +2,8 @@ namespace Drupal\social_comment_upload\Form; +use Drupal\Core\Config\TypedConfigManagerInterface; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; @@ -21,7 +21,7 @@ class SocialCommentUploadSettingsForm extends ConfigFormBase { * * @var \Drupal\Core\Extension\ModuleHandlerInterface */ - protected null|ModuleHandlerInterface|\Drupal\Core\Config\TypedConfigManagerInterface $moduleHandler; + protected null|ModuleHandlerInterface|TypedConfigManagerInterface $moduleHandler; /** * {@inheritdoc} diff --git a/modules/social_features/social_content_block/src/SocialContentBlockOverride.php b/modules/social_features/social_content_block/src/SocialContentBlockOverride.php index f7d0054c7c8..e58a0d3710e 100644 --- a/modules/social_features/social_content_block/src/SocialContentBlockOverride.php +++ b/modules/social_features/social_content_block/src/SocialContentBlockOverride.php @@ -2,6 +2,8 @@ namespace Drupal\social_content_block; +use Drupal\Core\Config\StorableConfigBase; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\block_content\Entity\BlockContent; use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Config\ConfigFactoryOverrideInterface; @@ -196,7 +198,7 @@ public function loadOverrides($names): array { * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ - protected static function getBlockContent(): \Drupal\Core\Entity\EntityStorageInterface { + protected static function getBlockContent(): EntityStorageInterface { return \Drupal::entityTypeManager() ->getStorage('block_content'); } @@ -218,7 +220,7 @@ public function getCacheableMetadata($name): CacheableMetadata { /** * {@inheritdoc} */ - public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION): ?\Drupal\Core\Config\StorableConfigBase { + public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION): ?StorableConfigBase { return NULL; } diff --git a/modules/social_features/social_content_report/src/EventSubscriber/FlagSubscriber.php b/modules/social_features/social_content_report/src/EventSubscriber/FlagSubscriber.php index ed205aa2a37..dc104d43778 100644 --- a/modules/social_features/social_content_report/src/EventSubscriber/FlagSubscriber.php +++ b/modules/social_features/social_content_report/src/EventSubscriber/FlagSubscriber.php @@ -4,9 +4,6 @@ use Drupal\Core\Cache\CacheTagsInvalidatorInterface; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Entity\ContentEntityInterface; -use Drupal\Core\Entity\EditorialContentEntityBase; -use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageException; use Drupal\Core\Logger\LoggerChannelTrait; use Drupal\Core\Messenger\MessengerInterface; @@ -110,7 +107,7 @@ public function onFlag(FlaggingEvent $event): void { // Do nothing unless we need to unpublish the entity immediately. if ($this->unpublishImmediately) { try { - /** @var ContentEntityInterface $entity */ + /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ $entity->set('status', 0); $entity->save(); $invalidated = TRUE; diff --git a/modules/social_features/social_content_report/src/Form/ContentReportSettingsForm.php b/modules/social_features/social_content_report/src/Form/ContentReportSettingsForm.php index 8f68e1d95af..68493bbb99e 100644 --- a/modules/social_features/social_content_report/src/Form/ContentReportSettingsForm.php +++ b/modules/social_features/social_content_report/src/Form/ContentReportSettingsForm.php @@ -6,8 +6,6 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\taxonomy\Entity\Term; -use Drupal\taxonomy\TermInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -80,7 +78,7 @@ public function buildForm(array $form, FormStateInterface $form_state): array { // A list of reason terms to display the reason textfield for. $terms = $this->entityTypeManager->getStorage('taxonomy_term')->loadTree('report_reasons'); $reason_terms = []; - /** @var TermInterface $term */ + /** @var \Drupal\taxonomy\TermInterface $term */ foreach ($terms as $term) { $reason_terms[$term->get('tid')->getValue()] = $term->getName(); } diff --git a/modules/social_features/social_content_report/src/Plugin/views/field/ReportContentType.php b/modules/social_features/social_content_report/src/Plugin/views/field/ReportContentType.php index 24af680b13b..a46c991d67d 100644 --- a/modules/social_features/social_content_report/src/Plugin/views/field/ReportContentType.php +++ b/modules/social_features/social_content_report/src/Plugin/views/field/ReportContentType.php @@ -2,6 +2,7 @@ namespace Drupal\social_content_report\Plugin\views\field; +use Drupal\Component\Render\MarkupInterface; use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\views\ResultRow; @@ -22,7 +23,7 @@ public function query(): void {} /** * {@inheritdoc} */ - public function render(ResultRow $row): \Drupal\Component\Render\MarkupInterface|string { + public function render(ResultRow $row): MarkupInterface|string { /** @var \Drupal\flag\FlaggingInterface $flagging */ $flagging = $this ->getEntity($row); diff --git a/modules/social_features/social_core/social_core.install b/modules/social_features/social_core/social_core.install index a6ab89c0045..7680e322532 100644 --- a/modules/social_features/social_core/social_core.install +++ b/modules/social_features/social_core/social_core.install @@ -174,7 +174,7 @@ function _social_core_create_an_homepage_block(): void { 'info' => 'AN homepage hero block', 'uuid' => '8bb9d4bb-f182-4afc-b138-8a4b802824e4', ]); - $block->set('field_text_block', [ + $block->set('field_text_block', [ 'value' => '

Become a member or log in to your community

This community is powered by Open Social, the plug-and-play community solution for NGOs and semi-governmental organizations.

', 'format' => 'full_html', ]); diff --git a/modules/social_features/social_core/social_core.module b/modules/social_features/social_core/social_core.module index cf4d0373274..db1fe492de2 100644 --- a/modules/social_features/social_core/social_core.module +++ b/modules/social_features/social_core/social_core.module @@ -1,12 +1,12 @@ $message) { // Unset them finally. - if (str_contains((string)$message, 'The crop')) { + if (str_contains((string) $message, 'The crop')) { unset($variables['message_list']['status'][$delta]); } } diff --git a/modules/social_features/social_core/src/Entity/EntityAutocompleteMatcher.php b/modules/social_features/social_core/src/Entity/EntityAutocompleteMatcher.php index 955c484bca2..74423843e08 100644 --- a/modules/social_features/social_core/src/Entity/EntityAutocompleteMatcher.php +++ b/modules/social_features/social_core/src/Entity/EntityAutocompleteMatcher.php @@ -5,7 +5,6 @@ use Drupal\Core\Entity\EntityAutocompleteMatcher as EntityAutocompleteMatcherBase; use Drupal\Component\Utility\Tags; use Drupal\Component\Utility\Html; -use Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface; /** * Class EntityAutocompleteMatcher. @@ -24,7 +23,7 @@ public function getMatches($target_type, $selection_handler, $selection_settings 'target_type' => $target_type, 'handler' => $selection_handler, ]; - /** @var SelectionInterface $handler */ + /** @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface $handler */ $handler = $this->selectionManager->getInstance($options); // Get an array of matching entities. diff --git a/modules/social_features/social_core/src/Entity/Select2EntityAutocompleteMatcher.php b/modules/social_features/social_core/src/Entity/Select2EntityAutocompleteMatcher.php index 43b68de2fc2..d3614520ba2 100644 --- a/modules/social_features/social_core/src/Entity/Select2EntityAutocompleteMatcher.php +++ b/modules/social_features/social_core/src/Entity/Select2EntityAutocompleteMatcher.php @@ -2,8 +2,6 @@ namespace Drupal\social_core\Entity; -use Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface; -use Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager; use Drupal\select2\EntityAutocompleteMatcher as EntityAutocompleteMatcherBase; use Drupal\Component\Utility\Html; use Drupal\social_user\VerifyableUserInterface; @@ -26,7 +24,7 @@ public function getMatches($target_type, $selection_handler, array $selection_se 'target_type' => $target_type, 'handler' => $selection_handler, ]; - /** @var SelectionInterface $handler */ + /** @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface $handler */ $handler = $this->selectionManager->getInstance($options); // Get an array of matching entities. diff --git a/modules/social_features/social_core/src/EventSubscriber/SocialInviteSubscriber.php b/modules/social_features/social_core/src/EventSubscriber/SocialInviteSubscriber.php index 828c0a66501..f14ed98f263 100644 --- a/modules/social_features/social_core/src/EventSubscriber/SocialInviteSubscriber.php +++ b/modules/social_features/social_core/src/EventSubscriber/SocialInviteSubscriber.php @@ -2,6 +2,8 @@ namespace Drupal\social_core\EventSubscriber; +use Drupal\Core\Config\ImmutableConfig; +use Drupal\Core\Config\Config; use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Messenger\MessengerInterface; use Drupal\Core\Routing\CurrentRouteMatch; @@ -55,14 +57,14 @@ class SocialInviteSubscriber implements EventSubscriberInterface { * * @var \Drupal\Core\Config\Config|\Drupal\Core\Config\ImmutableConfig */ - protected \Drupal\Core\Config\Config|\Drupal\Core\Config\ImmutableConfig $alternativeFrontpageSettings; + protected Config|ImmutableConfig $alternativeFrontpageSettings; /** * The site settings. * * @var \Drupal\Core\Config\Config|\Drupal\Core\Config\ImmutableConfig */ - protected \Drupal\Core\Config\Config|\Drupal\Core\Config\ImmutableConfig $siteSettings; + protected Config|ImmutableConfig $siteSettings; /** * Constructs SocialInviteSubscriber. diff --git a/modules/social_features/social_core/src/Plugin/Block/SocialPageTitleBlock.php b/modules/social_features/social_core/src/Plugin/Block/SocialPageTitleBlock.php index fdff94270df..05d902aaa16 100644 --- a/modules/social_features/social_core/src/Plugin/Block/SocialPageTitleBlock.php +++ b/modules/social_features/social_core/src/Plugin/Block/SocialPageTitleBlock.php @@ -11,7 +11,6 @@ use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Routing\RouteObjectInterface; use Drupal\node\NodeInterface; -use Drupal\tour\Annotation\Tip; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; @@ -37,7 +36,7 @@ class SocialPageTitleBlock extends PageTitleBlock implements ContainerFactoryPlu /** * The request stack. * - * @var RequestStack + * @var \Symfony\Component\HttpFoundation\RequestStack */ protected RequestStack $requestStack; diff --git a/modules/social_features/social_core/src/Plugin/Field/FieldFormatter/FileAndImageTableFormatter.php b/modules/social_features/social_core/src/Plugin/Field/FieldFormatter/FileAndImageTableFormatter.php index ef8ef26c202..ac3c67e55fe 100644 --- a/modules/social_features/social_core/src/Plugin/Field/FieldFormatter/FileAndImageTableFormatter.php +++ b/modules/social_features/social_core/src/Plugin/Field/FieldFormatter/FileAndImageTableFormatter.php @@ -2,7 +2,6 @@ namespace Drupal\social_core\Plugin\Field\FieldFormatter; -use Drupal\Core\Field\EntityReferenceFieldItemListInterface; use Drupal\Core\Field\FieldItemListInterface; use Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter; use Drupal\file\FileInterface; diff --git a/modules/social_features/social_embed/src/SocialEmbedConfigOverride.php b/modules/social_features/social_embed/src/SocialEmbedConfigOverride.php index 04b415dc666..0c9ab3e2150 100644 --- a/modules/social_features/social_embed/src/SocialEmbedConfigOverride.php +++ b/modules/social_features/social_embed/src/SocialEmbedConfigOverride.php @@ -2,6 +2,7 @@ namespace Drupal\social_embed; +use Drupal\Core\Config\StorableConfigBase; use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\ConfigFactoryOverrideInterface; @@ -146,7 +147,7 @@ public function getCacheableMetadata($name): CacheableMetadata { /** * {@inheritdoc} */ - public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION): ?\Drupal\Core\Config\StorableConfigBase { + public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION): ?StorableConfigBase { return NULL; } diff --git a/modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.module b/modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.module index 7888df615f6..bb3c1f1ff05 100644 --- a/modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.module +++ b/modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.module @@ -1,12 +1,12 @@ socialEventAnEnrollManager->getGuestName($entity, FALSE); if (!$display_name) { diff --git a/modules/social_features/social_event/modules/social_event_an_enroll/src/Plugin/views/access/ManageEnrollmentAccess.php b/modules/social_features/social_event/modules/social_event_an_enroll/src/Plugin/views/access/ManageEnrollmentAccess.php index 39ec3b03610..0caefb6635a 100644 --- a/modules/social_features/social_event/modules/social_event_an_enroll/src/Plugin/views/access/ManageEnrollmentAccess.php +++ b/modules/social_features/social_event/modules/social_event_an_enroll/src/Plugin/views/access/ManageEnrollmentAccess.php @@ -2,6 +2,7 @@ namespace Drupal\social_event_an_enroll\Plugin\views\access; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Session\AccountInterface; use Symfony\Component\Routing\Route; use Drupal\views\Plugin\views\access\AccessPluginBase; @@ -22,7 +23,7 @@ class ManageEnrollmentAccess extends AccessPluginBase { /** * {@inheritdoc} */ - public function summaryTitle(): \Drupal\Core\StringTranslation\TranslatableMarkup { + public function summaryTitle(): TranslatableMarkup { return $this->t('Unrestricted'); } diff --git a/modules/social_features/social_event/modules/social_event_an_enroll/src/Plugin/views/field/SocialEventAnEnrollViewsBulkOperationsBulkForm.php b/modules/social_features/social_event/modules/social_event_an_enroll/src/Plugin/views/field/SocialEventAnEnrollViewsBulkOperationsBulkForm.php index c98527dc1fe..e8b446aa8f2 100644 --- a/modules/social_features/social_event/modules/social_event_an_enroll/src/Plugin/views/field/SocialEventAnEnrollViewsBulkOperationsBulkForm.php +++ b/modules/social_features/social_event/modules/social_event_an_enroll/src/Plugin/views/field/SocialEventAnEnrollViewsBulkOperationsBulkForm.php @@ -6,8 +6,6 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Drupal\social_event_an_enroll\EventAnEnrollManager; use Drupal\social_event_managers\Plugin\views\field\SocialEventManagersViewsBulkOperationsBulkForm; @@ -21,7 +19,7 @@ /** * Defines the Views Bulk Operations field plugin. */ -class SocialEventAnEnrollViewsBulkOperationsBulkForm extends SocialEventManagersViewsBulkOperationsBulkForm implements ContainerFactoryPluginInterface { +class SocialEventAnEnrollViewsBulkOperationsBulkForm extends SocialEventManagersViewsBulkOperationsBulkForm { /** * The event an enroll manager. @@ -55,13 +53,15 @@ class SocialEventAnEnrollViewsBulkOperationsBulkForm extends SocialEventManagers * The entity type manager. * @param \Drupal\Core\Action\ActionManager $pluginActionManager * The action manager. + * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory + * The config factory. * @param \Drupal\social_event_an_enroll\EventAnEnrollManager $social_event_an_enroll_manager * The event an enroll manager. */ public function __construct( array $configuration, - $plugin_id, - $plugin_definition, + $plugin_id, + $plugin_definition, ViewsBulkOperationsViewDataInterface $viewData, ViewsBulkOperationsActionManager $actionManager, ViewsBulkOperationsActionProcessorInterface $actionProcessor, @@ -70,26 +70,10 @@ public function __construct( RequestStack $requestStack, EntityTypeManagerInterface $entity_type_manager, ActionManager $pluginActionManager, - RouteMatchInterface $routeMatch, ConfigFactoryInterface $config_factory, EventAnEnrollManager $social_event_an_enroll_manager, ) { - parent::__construct( - $configuration, - $plugin_id, - $plugin_definition, - $viewData, - $actionManager, - $actionProcessor, - $tempStoreFactory, - $currentUser, - $requestStack, - $entity_type_manager, - $pluginActionManager, - $routeMatch, - $config_factory, - ); - + parent::__construct($configuration, $plugin_id, $plugin_definition, $viewData, $actionManager, $actionProcessor, $tempStoreFactory, $currentUser, $requestStack, $entity_type_manager, $pluginActionManager, $config_factory); $this->socialEventAnEnrollManager = $social_event_an_enroll_manager; } @@ -109,9 +93,8 @@ public static function create(ContainerInterface $container, array $configuratio $container->get('request_stack'), $container->get('entity_type.manager'), $container->get('plugin.manager.action'), - $container->get('current_route_match'), $container->get('config.factory'), - $container->get('social_event_an_enroll.manager'), + $container->get('social_event_an_enroll.manager') ); } diff --git a/modules/social_features/social_event/modules/social_event_an_enroll_enrolments_export/src/Plugin/Action/ExportAllEnrolments.php b/modules/social_features/social_event/modules/social_event_an_enroll_enrolments_export/src/Plugin/Action/ExportAllEnrolments.php index 94279d5585f..8365c96d5dc 100644 --- a/modules/social_features/social_event/modules/social_event_an_enroll_enrolments_export/src/Plugin/Action/ExportAllEnrolments.php +++ b/modules/social_features/social_event/modules/social_event_an_enroll_enrolments_export/src/Plugin/Action/ExportAllEnrolments.php @@ -2,6 +2,9 @@ namespace Drupal\social_event_an_enroll_enrolments_export\Plugin\Action; +use Drupal\Core\Access\AccessResultInterface; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\social_user_export\Plugin\Action\ExportUser; use Drupal\Core\Access\AccessResult; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\File\FileSystem; @@ -66,6 +69,8 @@ class ExportAllEnrolments extends ExportEnrolments { * The file url generator service. * @param \Drupal\social_event_an_enroll\EventAnEnrollManager $social_event_an_enroll_manager * The event an enroll manager. + * @param \Drupal\Core\File\FileSystem $file_system + * The file system service. */ public function __construct( array $configuration, @@ -115,7 +120,7 @@ public function __construct( /** * {@inheritdoc} */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): \Drupal\social_user_export\Plugin\Action\ExportUser|\Drupal\Core\Plugin\ContainerFactoryPluginInterface|static { + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): ExportUser|ContainerFactoryPluginInterface|static { return new static($configuration, $plugin_id, $plugin_definition, $container->get('plugin.manager.user_export_plugin'), $container->get('logger.factory')->get('action'), @@ -140,7 +145,7 @@ public function executeMultiple(array $entities): array { /** * {@inheritdoc} */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE): bool|\Drupal\Core\Access\AccessResultInterface { + public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE): bool|AccessResultInterface { if ($object instanceof EventEnrollmentInterface) { if ($this->socialEventAnEnrollManager->isGuest($object)) { $access = AccessResult::allowed(); diff --git a/modules/social_features/social_event/modules/social_event_enrolments_export/src/Plugin/Action/ExportEnrolments.php b/modules/social_features/social_event/modules/social_event_enrolments_export/src/Plugin/Action/ExportEnrolments.php index 06934bd4794..37e93eb6a83 100644 --- a/modules/social_features/social_event/modules/social_event_enrolments_export/src/Plugin/Action/ExportEnrolments.php +++ b/modules/social_features/social_event/modules/social_event_enrolments_export/src/Plugin/Action/ExportEnrolments.php @@ -2,6 +2,7 @@ namespace Drupal\social_event_enrolments_export\Plugin\Action; +use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\Access\AccessResult; use Drupal\Core\Session\AccountInterface; use Drupal\social_event\EventEnrollmentInterface; @@ -35,7 +36,7 @@ public function executeMultiple(array $entities): array { /** * {@inheritdoc} */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE): bool|\Drupal\Core\Access\AccessResultInterface { + public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE): bool|AccessResultInterface { if ($object instanceof EventEnrollmentInterface) { $access = $this->getAccount($object)->access('view', $account, TRUE); } diff --git a/modules/social_features/social_event/modules/social_event_invite/social_event_invite.module b/modules/social_features/social_event/modules/social_event_invite/social_event_invite.module index 8563b8a4581..173e223f142 100644 --- a/modules/social_features/social_event/modules/social_event_invite/social_event_invite.module +++ b/modules/social_features/social_event/modules/social_event_invite/social_event_invite.module @@ -1,18 +1,16 @@ get('field_request_or_invite_status')->value = EventEnrollmentInterface::REQUEST_OR_INVITE_DECLINED; $statusMessage = $this->getMessage($event_enrollment, $accept_decline); - if ($statusMessage !== null) { + if ($statusMessage !== NULL) { // Let's delete all messages to keep the messages clean. $this->messenger()->deleteAll(); $this->messenger()->addStatus($statusMessage); @@ -73,7 +74,7 @@ public function updateEnrollmentInvite(EventEnrollmentInterface $event_enrollmen * @return \Drupal\Core\StringTranslation\TranslatableMarkup|null * The message. */ - public function getMessage(EventEnrollmentInterface $event_enrollment, string $accept_decline): ?\Drupal\Core\StringTranslation\TranslatableMarkup { + public function getMessage(EventEnrollmentInterface $event_enrollment, string $accept_decline): ?TranslatableMarkup { $statusMessage = NULL; // Get the target event id. $target_event_id = $event_enrollment->get('field_event')->getValue(); diff --git a/modules/social_features/social_event/modules/social_event_invite/src/Plugin/Menu/LocalTask/EventInviteLocalTask.php b/modules/social_features/social_event/modules/social_event_invite/src/Plugin/Menu/LocalTask/EventInviteLocalTask.php index bbe9c77473e..7396b2cfb1e 100644 --- a/modules/social_features/social_event/modules/social_event_invite/src/Plugin/Menu/LocalTask/EventInviteLocalTask.php +++ b/modules/social_features/social_event/modules/social_event_invite/src/Plugin/Menu/LocalTask/EventInviteLocalTask.php @@ -2,6 +2,7 @@ namespace Drupal\social_event_invite\Plugin\Menu\LocalTask; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Cache\Cache; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Menu\LocalTaskDefault; @@ -56,7 +57,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function getTitle(Request $request = NULL): string|\Drupal\Core\StringTranslation\TranslatableMarkup { + public function getTitle(Request $request = NULL): string|TranslatableMarkup { /** @var \Drupal\social_event\EventEnrollmentStatusHelper $enrollments */ $enrollments = \Drupal::service('social_event.status_helper'); diff --git a/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteBulkHelper.php b/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteBulkHelper.php index 4804ee9d88b..7dea545a3fb 100644 --- a/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteBulkHelper.php +++ b/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteBulkHelper.php @@ -2,10 +2,7 @@ namespace Drupal\social_event_invite; -use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException; -use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Core\Cache\Cache; -use Drupal\Core\Entity\EntityStorageException; use Drupal\Core\Url; use Drupal\social_event\Entity\EventEnrollment; use Drupal\social_event\EventEnrollmentInterface; @@ -158,9 +155,9 @@ public static function bulkInviteEmails(array $emails, string $nid, array &$cont * @param array $context * The context. * - * @throws InvalidPluginDefinitionException - * @throws PluginNotFoundException - * @throws EntityStorageException + * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException + * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException + * @throws \Drupal\Core\Entity\EntityStorageException */ public static function bulkInviteUsersEmails(array $users, string $nid, array &$context): void { /** @var \ArrayAccess $results */ diff --git a/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteConfigOverride.php b/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteConfigOverride.php index f8913674f38..362c7d9e625 100644 --- a/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteConfigOverride.php +++ b/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteConfigOverride.php @@ -2,6 +2,7 @@ namespace Drupal\social_event_invite; +use Drupal\Core\Config\StorableConfigBase; use Drupal\Component\Utility\EmailValidatorInterface; use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Config\ConfigFactoryInterface; @@ -214,7 +215,7 @@ public function getCacheableMetadata($name): CacheableMetadata { * @return \Drupal\Core\Config\StorableConfigBase|null * The configuration object for the provided name and collection. */ - public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION): ?\Drupal\Core\Config\StorableConfigBase { + public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION): ?StorableConfigBase { return NULL; } diff --git a/modules/social_features/social_event/modules/social_event_managers/social_event_managers.module b/modules/social_features/social_event/modules/social_event_managers/social_event_managers.module index 119694f3cc1..1498b6f9824 100644 --- a/modules/social_features/social_event/modules/social_event_managers/social_event_managers.module +++ b/modules/social_features/social_event/modules/social_event_managers/social_event_managers.module @@ -365,7 +365,7 @@ function social_event_managers_node_grants(AccountInterface $account, string $op * we are in operation update and if gnode already returns forbidden we are able * to return an allowed if user is an event manager. */ -function social_event_managers_node_access(NodeInterface $node,string $op, AccountInterface $account): AccessResult { +function social_event_managers_node_access(NodeInterface $node, string $op, AccountInterface $account): AccessResult { return SocialEventManagersAccessHelper::getEntityAccessResult($node, $op, $account); } diff --git a/modules/social_features/social_event/modules/social_event_managers/src/Plugin/Action/SocialEventManagersSendEmail.php b/modules/social_features/social_event/modules/social_event_managers/src/Plugin/Action/SocialEventManagersSendEmail.php index 3da2627e0d6..8651ef7fa49 100644 --- a/modules/social_features/social_event/modules/social_event_managers/src/Plugin/Action/SocialEventManagersSendEmail.php +++ b/modules/social_features/social_event/modules/social_event_managers/src/Plugin/Action/SocialEventManagersSendEmail.php @@ -4,7 +4,6 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Access\AccessResultInterface; -use Drupal\Core\Entity\ContentEntityBase; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Language\LanguageManagerInterface; @@ -38,8 +37,10 @@ class SocialEventManagersSendEmail extends SocialSendEmail { /** * The entity type manager. + * + * @var \Drupal\Core\Entity\EntityTypeManagerInterface */ - protected EntityTypeManagerInterface $entityTypeManager; + protected $entityTypeManager; /** * The email broadcast service. @@ -147,7 +148,7 @@ public function executeMultiple(array $objects): array { } // Pass it back to our parent who handles the creation of queue items. - return parent::executeMultiple($users ?? []); + return parent::executeMultiple($users); } /** @@ -171,7 +172,7 @@ public function access($object, AccountInterface $account = NULL, $return_as_obj $access = AccessResult::allowedIfHasPermission($account, 'manage everything enrollments'); } - /** @var ContentEntityBase $object */ + /** @var \Drupal\Core\Entity\ContentEntityBase $object */ $event_id = $object->getFieldValue('field_event', 'target_id'); $node = $this->entityTypeManager->getStorage('node')->load($event_id); diff --git a/modules/social_features/social_event/modules/social_event_managers/src/Plugin/views/field/SocialEventManagersViewsBulkOperationsBulkForm.php b/modules/social_features/social_event/modules/social_event_managers/src/Plugin/views/field/SocialEventManagersViewsBulkOperationsBulkForm.php index 2734865a1c9..7125d381931 100644 --- a/modules/social_features/social_event/modules/social_event_managers/src/Plugin/views/field/SocialEventManagersViewsBulkOperationsBulkForm.php +++ b/modules/social_features/social_event/modules/social_event_managers/src/Plugin/views/field/SocialEventManagersViewsBulkOperationsBulkForm.php @@ -4,12 +4,10 @@ use Drupal\Core\Action\ActionManager; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\Element; -use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; use Drupal\Core\TempStore\PrivateTempStoreFactory; @@ -35,28 +33,21 @@ class SocialEventManagersViewsBulkOperationsBulkForm extends ViewsBulkOperations * * @var \Drupal\Core\Entity\EntityTypeManagerInterface */ - protected EntityTypeManagerInterface $entityTypeManager; + protected $entityTypeManager; /** * The action plugin manager. * * @var \Drupal\Core\Action\ActionManager */ - protected ActionManager $pluginActionManager; - - /** - * The route match. - * - * @var \Drupal\Core\Routing\RouteMatchInterface - */ - private RouteMatchInterface $routeMatch; + protected $pluginActionManager; /** * The config factory. * * @var \Drupal\Core\Config\ConfigFactoryInterface */ - protected ConfigFactoryInterface $configFactory; + protected $configFactory; /** * Constructs a new SocialEventManagersViewsBulkOperationsBulkForm object. @@ -83,11 +74,13 @@ class SocialEventManagersViewsBulkOperationsBulkForm extends ViewsBulkOperations * The entity type manager. * @param \Drupal\Core\Action\ActionManager $pluginActionManager * The action manager. + * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory + * The config factory. */ public function __construct( array $configuration, - $plugin_id, - $plugin_definition, + $plugin_id, + $plugin_definition, ViewsBulkOperationsViewDataInterface $viewData, ViewsBulkOperationsActionManager $actionManager, ViewsBulkOperationsActionProcessorInterface $actionProcessor, @@ -96,13 +89,13 @@ public function __construct( RequestStack $requestStack, EntityTypeManagerInterface $entity_type_manager, ActionManager $pluginActionManager, - RouteMatchInterface $routeMatch, - ConfigFactoryInterface $config_factory, + ConfigFactoryInterface $config_factory ) { parent::__construct($configuration, $plugin_id, $plugin_definition, $viewData, $actionManager, $actionProcessor, $tempStoreFactory, $currentUser, $requestStack); $this->entityTypeManager = $entity_type_manager; $this->pluginActionManager = $pluginActionManager; + $this->configFactory = $config_factory; } /** @@ -121,8 +114,7 @@ public static function create(ContainerInterface $container, array $configuratio $container->get('request_stack'), $container->get('entity_type.manager'), $container->get('plugin.manager.action'), - $container->get('current_route_match'), - $container->get('config.factory'), + $container->get('config.factory') ); } @@ -190,12 +182,10 @@ public function viewsForm(array &$form, FormStateInterface $form_state): void { $list = &$form[$this->options['id']]; foreach ($this->view->result as $row_index => $row) { - /** @var \Drupal\Core\Entity\ContentEntityInterface|NULL $entity */ $entity = $this->getEntity($row); - if ($entity === NULL) { - continue; + if ($entity !== NULL) { + $list[$row_index]['#title'] = $this->getEntityLabel($entity); } - $list[$row_index]['#title'] = $this->getEntityLabel($entity); } } @@ -401,7 +391,7 @@ public function viewsFormSubmit(array &$form, FormStateInterface $form_state): v $parameters = $url->getRouteParameters(); if (empty($parameters['node'])) { - $node = $this->routeMatch->getParameter('node'); + $node = \Drupal::routeMatch()->getParameter('node'); if ($node instanceof NodeInterface) { // You can get nid and anything else you need from the node object. $parameters['node'] = $node->id(); @@ -423,16 +413,17 @@ public function viewsFormSubmit(array &$form, FormStateInterface $form_state): v /** * Returns modified entity label. * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity + * @param \Drupal\Core\Entity\EntityInterface $entity * The entity. * * @return string * The label text. */ - public function getEntityLabel(ContentEntityInterface $entity): string { + public function getEntityLabel(EntityInterface $entity): string { + /** @var \Drupal\Core\Entity\ContentEntityBase $entity */ $profiles = $this->entityTypeManager->getStorage('profile') ->loadByProperties([ - 'uid' => $entity->get('field_account')->target_id + 'uid' => $entity->getFieldValue('field_account', 'target_id'), ]); $profile = reset($profiles); @@ -489,7 +480,7 @@ protected function getTempstoreData($view_id = NULL, $display_id = NULL): ?array * @return array * Returns array of bulk options. */ - protected function bulkOptionAccess(array $bulkOptions): array { + protected function bulkOptionAccess(array $bulkOptions) { /** @var \Drupal\node\NodeInterface $event */ $event = social_event_get_current_event(); $isEventOrganizer = social_event_manager_or_organizer($event); diff --git a/modules/social_features/social_event/modules/social_event_max_enroll/social_event_max_enroll.module b/modules/social_features/social_event/modules/social_event_max_enroll/social_event_max_enroll.module index dbd1c1f9827..7a16abeb4bf 100644 --- a/modules/social_features/social_event/modules/social_event_max_enroll/social_event_max_enroll.module +++ b/modules/social_features/social_event/modules/social_event_max_enroll/social_event_max_enroll.module @@ -24,7 +24,7 @@ function social_event_max_enroll_views_post_render(ViewExecutable $view, array & !empty($view->args[0]) ) { $nid = $view->args[0]; - /** @var NodeInterface $node */ + /** @var \Drupal\node\NodeInterface $node */ $node = \Drupal::entityTypeManager()->getStorage('node')->load($nid); $event_max_enroll_service = \Drupal::service('social_event_max_enroll.service'); diff --git a/modules/social_features/social_event/social_event.tokens.inc b/modules/social_features/social_event/social_event.tokens.inc index a207f17e279..9c3d91969d1 100644 --- a/modules/social_features/social_event/social_event.tokens.inc +++ b/modules/social_features/social_event/social_event.tokens.inc @@ -5,6 +5,7 @@ * Builds placeholder replacement tokens for Social Event module. */ +use Drupal\node\Entity\Node; use Drupal\Core\Render\BubbleableMetadata; use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Link; @@ -300,7 +301,7 @@ function _social_event_get_name_from_enrollment(int $id): mixed { * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ -function _social_event_get_event_from_enrollment(int $event_enrollment_id): ?\Drupal\node\Entity\Node { +function _social_event_get_event_from_enrollment(int $event_enrollment_id): ?Node { $entity_storage = \Drupal::entityTypeManager() ->getStorage('event_enrollment'); if ($entity = $entity_storage->load($event_enrollment_id)) { diff --git a/modules/social_features/social_event/src/Controller/EnrollRequestDialogController.php b/modules/social_features/social_event/src/Controller/EnrollRequestDialogController.php index 3f4c132a233..d8d8dfa727f 100644 --- a/modules/social_features/social_event/src/Controller/EnrollRequestDialogController.php +++ b/modules/social_features/social_event/src/Controller/EnrollRequestDialogController.php @@ -2,6 +2,7 @@ namespace Drupal\social_event\Controller; +use Drupal\Core\Access\AccessResultAllowed; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Access\AccessResult; use Drupal\Core\Ajax\AjaxResponse; @@ -116,7 +117,7 @@ public function enrollTitle(NodeInterface $node): string { /** * Determines if user has access to enroll form. */ - public function enrollAccess(NodeInterface $node): \Drupal\Core\Access\AccessResultAllowed { + public function enrollAccess(NodeInterface $node): AccessResultAllowed { return AccessResult::allowed(); } diff --git a/modules/social_features/social_event/src/Controller/SocialEventController.php b/modules/social_features/social_event/src/Controller/SocialEventController.php index dfa2fa98d31..a081591c119 100644 --- a/modules/social_features/social_event/src/Controller/SocialEventController.php +++ b/modules/social_features/social_event/src/Controller/SocialEventController.php @@ -2,6 +2,7 @@ namespace Drupal\social_event\Controller; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Access\AccessResult; use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\Controller\ControllerBase; @@ -96,7 +97,7 @@ public function myEventAccess(AccountInterface $account): AccessResultInterface * @return \Drupal\Core\StringTranslation\TranslatableMarkup * The decline title markup. */ - public function getTitleDeclineRequest(): \Drupal\Core\StringTranslation\TranslatableMarkup { + public function getTitleDeclineRequest(): TranslatableMarkup { /** @var \Drupal\node\NodeInterface $node */ $node = $this->requestStack->getCurrentRequest()?->get('node'); diff --git a/modules/social_features/social_event/src/EdaEventEnrollmentHandler.php b/modules/social_features/social_event/src/EdaEventEnrollmentHandler.php index 2c020120d3e..e69d210a7eb 100644 --- a/modules/social_features/social_event/src/EdaEventEnrollmentHandler.php +++ b/modules/social_features/social_event/src/EdaEventEnrollmentHandler.php @@ -279,7 +279,6 @@ private function dispatch(string $topic_name, string $event_type, EventEnrollmen return; } - // An event enrolment should always have an event and a user associated // with it. if (!$event_enrollment->getEvent() || !$event_enrollment->getAccountEntity()) { diff --git a/modules/social_features/social_event/src/Entity/EventEnrollment.php b/modules/social_features/social_event/src/Entity/EventEnrollment.php index 647906c3b58..b732c1ce2cb 100644 --- a/modules/social_features/social_event/src/Entity/EventEnrollment.php +++ b/modules/social_features/social_event/src/Entity/EventEnrollment.php @@ -2,6 +2,7 @@ namespace Drupal\social_event\Entity; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Cache\Cache; use Drupal\Core\Entity\ContentEntityBase; use Drupal\Core\Entity\EntityChangedTrait; @@ -111,7 +112,7 @@ public function getName(): string { /** * {@inheritdoc} */ - public function label(): string|\Drupal\Core\StringTranslation\TranslatableMarkup|null { + public function label(): string|TranslatableMarkup|null { // When a guest is allowed to join the name and account fields can be empty, // but the field for email will be provided. // The first and last name are not mandatory, @@ -156,7 +157,7 @@ public function setCreatedTime($timestamp): EventEnrollmentInterface|static { * {@inheritdoc} */ public function getOwner(): UserInterface { - /** @var UserInterface $user */ + /** @var \Drupal\user\UserInterface $user */ $user = $this->get('user_id')->entity; return $user; } diff --git a/modules/social_features/social_event/src/EventEnrollmentStatusHelper.php b/modules/social_features/social_event/src/EventEnrollmentStatusHelper.php index e7a0948e321..b60fa8d6fef 100644 --- a/modules/social_features/social_event/src/EventEnrollmentStatusHelper.php +++ b/modules/social_features/social_event/src/EventEnrollmentStatusHelper.php @@ -5,7 +5,6 @@ use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException; use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountProxyInterface; @@ -71,9 +70,9 @@ public function __construct(RouteMatchInterface $routeMatch, EntityTypeManagerIn * * @param string $user * The email or userid you want to check on. - * @param int|NULL $event + * @param int|null $event * The event id you want to check on, use 0 for all. - * @param int|NULL $invite_status + * @param int|null $invite_status * The event status to filter on. * * @return array @@ -121,7 +120,7 @@ public function userEnrollments(string $user, int|NULL $event = NULL, int|NULL $ * * @param int $event * The event id you want to check on. - * @param int|NULL $invite_status + * @param int|null $invite_status * The event status to filter on. * * @return array @@ -145,9 +144,10 @@ public function eventEnrollments(int $event, int|NULL $invite_status = NULL): ar * Get all enrollments for a user. * * @param string $user - * The email or userid you want to check on. - * @return EntityInterface[] - * Returns all enrollments for a user. + * The email or userid you want to check on. + * + * @return \Drupal\Core\Entity\EntityInterface[] + * Returns all enrollments for a user. */ public function getAllUserEventEnrollments(string $user): array { $conditions = $this->userEnrollments($user, NULL); @@ -157,8 +157,9 @@ public function getAllUserEventEnrollments(string $user): array { try { return $this->entityTypeManager->getStorage('event_enrollment') ->loadByProperties($conditions); - } catch (InvalidPluginDefinitionException|PluginNotFoundException $e) { - return []; + } + catch (InvalidPluginDefinitionException | PluginNotFoundException $e) { + return []; } } diff --git a/modules/social_features/social_event/src/Form/EnrollActionForm.php b/modules/social_features/social_event/src/Form/EnrollActionForm.php index 0f4ea183400..95c1ad58013 100644 --- a/modules/social_features/social_event/src/Form/EnrollActionForm.php +++ b/modules/social_features/social_event/src/Form/EnrollActionForm.php @@ -2,6 +2,12 @@ namespace Drupal\social_event\Form; +use Drupal\social_event\EventEnrollmentStatusHelper; +use Drupal\Core\Form\FormBuilderInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\user\UserStorageInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\OpenModalDialogCommand; use Drupal\Core\Ajax\RedirectCommand; @@ -39,21 +45,21 @@ class EnrollActionForm extends FormBase { * * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected \Drupal\Core\Entity\EntityStorageInterface $enrollmentStorage; + protected EntityStorageInterface $enrollmentStorage; /** * The user storage. * * @var \Drupal\user\UserStorageInterface */ - protected \Drupal\user\UserStorageInterface $userStorage; + protected UserStorageInterface $userStorage; /** * The entity type manager. * * @var \Drupal\Core\Entity\EntityTypeManagerInterface */ - protected \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager; + protected EntityTypeManagerInterface $entityTypeManager; /** * The config factory. @@ -67,21 +73,21 @@ class EnrollActionForm extends FormBase { * * @var \Drupal\Core\Extension\ModuleHandlerInterface */ - protected \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler; + protected ModuleHandlerInterface $moduleHandler; /** * The form builder. * * @var \Drupal\Core\Form\FormBuilderInterface */ - protected \Drupal\Core\Form\FormBuilderInterface $formBuilder; + protected FormBuilderInterface $formBuilder; /** * The event invite status helper. * * @var \Drupal\social_event\EventEnrollmentStatusHelper */ - protected \Drupal\social_event\EventEnrollmentStatusHelper $eventHelper; + protected EventEnrollmentStatusHelper $eventHelper; /** * {@inheritdoc} diff --git a/modules/social_features/social_event/src/Form/EnrollRequestDeclineForm.php b/modules/social_features/social_event/src/Form/EnrollRequestDeclineForm.php index 3772a9a0ddb..47eddc963f4 100644 --- a/modules/social_features/social_event/src/Form/EnrollRequestDeclineForm.php +++ b/modules/social_features/social_event/src/Form/EnrollRequestDeclineForm.php @@ -25,7 +25,7 @@ class EnrollRequestDeclineForm extends FormBase { /** * The event enrollment entity. * - * @var \Drupal\social_event\Entity\EventEnrollment|NULL + * @var \Drupal\social_event\Entity\EventEnrollment|null */ protected ?EventEnrollment $eventEnrollment; diff --git a/modules/social_features/social_event/src/Form/EventEnrollmentForm.php b/modules/social_features/social_event/src/Form/EventEnrollmentForm.php index 69b7ceb83b3..fc9c89f2e4f 100644 --- a/modules/social_features/social_event/src/Form/EventEnrollmentForm.php +++ b/modules/social_features/social_event/src/Form/EventEnrollmentForm.php @@ -12,13 +12,6 @@ */ class EventEnrollmentForm extends ContentEntityForm { - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state): array { - return parent::buildForm($form, $form_state); - } - /** * {@inheritdoc} */ diff --git a/modules/social_features/social_event/src/Plugin/Block/EventRequestEnrollmentNotification.php b/modules/social_features/social_event/src/Plugin/Block/EventRequestEnrollmentNotification.php index eb9b7c02d66..74b477fc5d7 100644 --- a/modules/social_features/social_event/src/Plugin/Block/EventRequestEnrollmentNotification.php +++ b/modules/social_features/social_event/src/Plugin/Block/EventRequestEnrollmentNotification.php @@ -7,7 +7,6 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Block\BlockBase; use Drupal\Core\Cache\Cache; -use Drupal\Core\Entity\EntityBase; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Link; @@ -34,7 +33,7 @@ class EventRequestEnrollmentNotification extends BlockBase implements ContainerF /** * Event entity. * - * @var \Drupal\Core\Entity\EntityInterface|NULL + * @var \Drupal\Core\Entity\EntityInterface|null */ protected EntityInterface|NULL $event; @@ -161,7 +160,7 @@ public function build() :array { ], ]; } - catch (InvalidPluginDefinitionException|PluginNotFoundException $e) { + catch (InvalidPluginDefinitionException | PluginNotFoundException $e) { $this->loggerFactory->get('social_event')->error($e->getMessage()); } diff --git a/modules/social_features/social_event/src/Plugin/GraphQL/DataProducer/Field/DateToTimestamp.php b/modules/social_features/social_event/src/Plugin/GraphQL/DataProducer/Field/DateToTimestamp.php index 2fa83f38267..aa46aefa215 100644 --- a/modules/social_features/social_event/src/Plugin/GraphQL/DataProducer/Field/DateToTimestamp.php +++ b/modules/social_features/social_event/src/Plugin/GraphQL/DataProducer/Field/DateToTimestamp.php @@ -2,7 +2,6 @@ namespace Drupal\social_event\Plugin\GraphQL\DataProducer\Field; -use Drupal\Core\TypedData\Type\DateTimeInterface; use Drupal\datetime\Plugin\Field\FieldType\DateTimeFieldItemList; use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem; use Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase; @@ -40,7 +39,7 @@ public function resolve(DateTimeFieldItemList $field): ?int { return NULL; } - /** @var DateTimeInterface $date_item */ + /** @var \Drupal\Core\TypedData\Type\DateTimeInterface $date_item */ $date_item = $field->get(DateTimeItem::DATETIME_TYPE_DATE); return $date_item->getDateTime()?->getTimestamp(); diff --git a/modules/social_features/social_event/src/Plugin/views/filter/EventDate.php b/modules/social_features/social_event/src/Plugin/views/filter/EventDate.php index ee71bd62c0c..06d41a53b35 100644 --- a/modules/social_features/social_event/src/Plugin/views/filter/EventDate.php +++ b/modules/social_features/social_event/src/Plugin/views/filter/EventDate.php @@ -5,8 +5,6 @@ use Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface; use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\Plugin\views\filter\InOperator; -use Drupal\views\Plugin\views\join\JoinPluginBase; -use Drupal\views\Plugin\views\query\Sql; use Drupal\views\ViewExecutable; use Drupal\views\Views; @@ -48,7 +46,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o * {@inheritdoc} */ public function query(): void { - /** @var Sql $query */ + /** @var \Drupal\views\Plugin\views\query\Sql $query */ $query = $this->query; $value = (int) current($this->value); @@ -79,13 +77,13 @@ public function query(): void { 'left_field' => 'nid', ]; - /** @var JoinPluginBase $join */ + /** @var \Drupal\views\Plugin\views\join\JoinPluginBase $join */ $join = Views::pluginManager('join') ->createInstance('standard', $configuration); $alias = $query->addRelationship($configuration['table'], $join, $base_table); $field_end = $query->getDateFormat($alias . '.field_event_date_end_value', DateTimeItemInterface::DATETIME_STORAGE_FORMAT, TRUE); - /** @var JoinPluginBase $all_day_join */ + /** @var \Drupal\views\Plugin\views\join\JoinPluginBase $all_day_join */ $all_day_join = Views::pluginManager('join') ->createInstance('standard', $configuration_all_day); $all_day_alias = $query->addRelationship($configuration_all_day['table'], $all_day_join, $base_table); diff --git a/modules/social_features/social_event/src/Plugin/views/filter/EventEnrolledOrCreated.php b/modules/social_features/social_event/src/Plugin/views/filter/EventEnrolledOrCreated.php index 46ab3afa949..459c58c880a 100644 --- a/modules/social_features/social_event/src/Plugin/views/filter/EventEnrolledOrCreated.php +++ b/modules/social_features/social_event/src/Plugin/views/filter/EventEnrolledOrCreated.php @@ -6,8 +6,6 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\user\UserInterface; use Drupal\views\Plugin\views\filter\FilterPluginBase; -use Drupal\views\Plugin\views\join\JoinPluginBase; -use Drupal\views\Plugin\views\query\Sql; use Drupal\views\Views; /** @@ -44,7 +42,7 @@ public function canExpose(): FALSE { * Query for the activity stream on the account pages. */ public function query(): void { - /** @var Sql $query */ + /** @var \Drupal\views\Plugin\views\query\Sql $query */ $query = $this->query; $account_profile = \Drupal::routeMatch()->getParameter('user'); @@ -60,7 +58,7 @@ public function query(): void { 'left_field' => 'nid', 'operator' => '=', ]; - /** @var JoinPluginBase $join */ + /** @var \Drupal\views\Plugin\views\join\JoinPluginBase $join */ $join = Views::pluginManager('join')->createInstance('standard', $configuration); $query->addRelationship('event_enrollment__field_event', $join, 'node_field_data'); @@ -71,7 +69,7 @@ public function query(): void { 'left_field' => 'entity_id', 'operator' => '=', ]; - /** @var JoinPluginBase $join */ + /** @var \Drupal\views\Plugin\views\join\JoinPluginBase $join */ $join = Views::pluginManager('join')->createInstance('standard', $configuration); $query->addRelationship('event_enrollment_field_data', $join, 'node_field_data'); @@ -82,7 +80,7 @@ public function query(): void { 'left_field' => 'entity_id', 'operator' => '=', ]; - /** @var JoinPluginBase $join */ + /** @var \Drupal\views\Plugin\views\join\JoinPluginBase $join */ $join = Views::pluginManager('join')->createInstance('standard', $configuration); $query->addRelationship('event_enrollment__field_enrollment_status', $join, 'node_field_data'); @@ -93,7 +91,7 @@ public function query(): void { 'left_field' => 'entity_id', 'operator' => '=', ]; - /** @var JoinPluginBase $join */ + /** @var \Drupal\views\Plugin\views\join\JoinPluginBase $join */ $join = Views::pluginManager('join')->createInstance('standard', $configuration); $query->addRelationship('event_enrollment__field_account', $join, 'node_field_data'); diff --git a/modules/social_features/social_event/src/Plugin/views/sort/EventDate.php b/modules/social_features/social_event/src/Plugin/views/sort/EventDate.php index 660ba716eba..54690befeb6 100644 --- a/modules/social_features/social_event/src/Plugin/views/sort/EventDate.php +++ b/modules/social_features/social_event/src/Plugin/views/sort/EventDate.php @@ -2,7 +2,6 @@ namespace Drupal\social_event\Plugin\views\sort; -use Drupal\views\Plugin\views\query\Sql; use Drupal\views\Plugin\views\sort\Date; use Drupal\social_event\Plugin\views\filter\EventDate as EventDateFilter; @@ -20,7 +19,7 @@ public function query(): void { $this->ensureMyTable(); $order = ($this->view->exposed_data[$this->realField] === EventDateFilter::UPCOMING_EVENTS) ? 'ASC' : 'DESC'; - /** @var Sql $query */ + /** @var \Drupal\views\Plugin\views\query\Sql $query */ $query = $this->query; $query->addOrderBy($this->tableAlias, $this->realField, $order); $this->query = $query; diff --git a/modules/social_features/social_follow_content/social_follow_content.module b/modules/social_features/social_follow_content/social_follow_content.module index 6a33b2f0daf..885e1d866a3 100644 --- a/modules/social_features/social_follow_content/social_follow_content.module +++ b/modules/social_features/social_follow_content/social_follow_content.module @@ -5,7 +5,6 @@ * The Social Follow Content module. */ -use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Link; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\StringTranslation\TranslatableMarkup; @@ -58,7 +57,7 @@ function social_follow_content_event_enrollment_update(EntityInterface $entity): * Automatically follow content when user enrolls the event. */ function social_follow_content_event_enrollment_follow(EntityInterface $entity): void { - /** @var ContentEntityInterface $entity */ + /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ if ($entity->get('field_enrollment_status')->value) { // Check if user already follow this content. // Only logged-in users can follow content. diff --git a/modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php b/modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php index 5560cf412d2..aa0aba2b60e 100644 --- a/modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php +++ b/modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php @@ -4,7 +4,6 @@ use Drupal\activity_creator\ActivityFactory; use Drupal\activity_creator\Plugin\ActivityContextBase; -use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\Query\Sql\QueryFactory; use Drupal\group\Entity\GroupInterface; @@ -159,7 +158,6 @@ public function getRecipientsWhoFollowContent(array $related_entity, array $data } } - if ( $original_related_entity instanceof EntityOwnerInterface && $recipient->id() !== $original_related_entity->getOwnerId() && diff --git a/modules/social_features/social_follow_taxonomy/modules/social_follow_tag/src/Plugin/ActivityContext/FollowTagActivityContext.php b/modules/social_features/social_follow_taxonomy/modules/social_follow_tag/src/Plugin/ActivityContext/FollowTagActivityContext.php index fe196f85970..68b7b1f2410 100755 --- a/modules/social_features/social_follow_taxonomy/modules/social_follow_tag/src/Plugin/ActivityContext/FollowTagActivityContext.php +++ b/modules/social_features/social_follow_taxonomy/modules/social_follow_tag/src/Plugin/ActivityContext/FollowTagActivityContext.php @@ -2,7 +2,6 @@ namespace Drupal\social_follow_tag\Plugin\ActivityContext; -use Drupal\Core\Entity\ContentEntityInterface; use Drupal\social_follow_taxonomy\Plugin\ActivityContext\FollowTaxonomyActivityContext; use Drupal\user\UserInterface; @@ -18,12 +17,13 @@ class FollowTagActivityContext extends FollowTaxonomyActivityContext { /** * Returns recipients from followed taxonomies. + * * @throws \Exception */ public function getRecipientsWhoFollowTaxonomy(array $related_entity, array $data): array { $recipients = []; - /** @var ContentEntityInterface $entity */ + /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ $entity = $this->entityTypeManager->getStorage($related_entity['target_type']) ->load($related_entity['target_id']); diff --git a/modules/social_features/social_follow_taxonomy/social_follow_taxonomy.module b/modules/social_features/social_follow_taxonomy/social_follow_taxonomy.module index f629621c83b..b143af32db2 100755 --- a/modules/social_features/social_follow_taxonomy/social_follow_taxonomy.module +++ b/modules/social_features/social_follow_taxonomy/social_follow_taxonomy.module @@ -71,7 +71,7 @@ function social_follow_taxonomy_theme_suggestions_activity_alter( array &$suggestions, array $variables ): void { - /** @var ContentEntityInterface $activity */ + /** @var \Drupal\Core\Entity\ContentEntityInterface $activity */ $activity = $variables['elements']['#activity']; if ( @@ -89,7 +89,6 @@ function social_follow_taxonomy_theme_suggestions_activity_alter( $field = $activity->get('field_activity_entity'); $entity_type = $field->getFieldDefinition()->getSetting('target_type'); - if ($entity_type !== 'node' && $entity_type !== 'post') { return; } diff --git a/modules/social_features/social_follow_taxonomy/src/Plugin/ActivityContext/FollowTaxonomyActivityContext.php b/modules/social_features/social_follow_taxonomy/src/Plugin/ActivityContext/FollowTaxonomyActivityContext.php index 86e88fa9db3..1f36faafe5c 100755 --- a/modules/social_features/social_follow_taxonomy/src/Plugin/ActivityContext/FollowTaxonomyActivityContext.php +++ b/modules/social_features/social_follow_taxonomy/src/Plugin/ActivityContext/FollowTaxonomyActivityContext.php @@ -104,6 +104,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} + * * @throws \Exception */ public function getRecipients(array $data, int $last_id, int $limit): array { diff --git a/modules/social_features/social_group/modules/social_group_flexible_group/src/FlexibleGroupContentVisibilityUpdate.php b/modules/social_features/social_group/modules/social_group_flexible_group/src/FlexibleGroupContentVisibilityUpdate.php index e97586d6deb..05647295ba1 100644 --- a/modules/social_features/social_group/modules/social_group_flexible_group/src/FlexibleGroupContentVisibilityUpdate.php +++ b/modules/social_features/social_group/modules/social_group_flexible_group/src/FlexibleGroupContentVisibilityUpdate.php @@ -3,14 +3,11 @@ namespace Drupal\social_group_flexible_group; use Drupal\Core\Entity\ContentEntityInterface; -use Drupal\Core\Entity\EntityStorageException; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Cache\Cache; use Drupal\group\Entity\GroupInterface; -use Drupal\group\Entity\GroupRelationshipInterface; -use Drupal\group\GroupMembership; use Drupal\social_post\Entity\Post; use Drupal\node\Entity\Node; use Drupal\user\RoleInterface; @@ -54,7 +51,7 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, Mod /** * Update Group content after Group changed. * - * @param GroupInterface $group + * @param \Drupal\group\Entity\GroupInterface $group * The Group we've updated. * @param array $changed_visibility * The Group's old visibility. @@ -107,14 +104,14 @@ public static function batchUpdateGroupContentVisibility(GroupInterface $group, /** * Update visibility for all Group Content based on a new group type. * - * @param ContentEntityInterface $entity + * @param \Drupal\Core\Entity\ContentEntityInterface $entity * The content we are updating. * @param array $new_options * The Group's new visibility options. * @param array $context * Passed on by reference. * - * @throws EntityStorageException + * @throws \Drupal\Core\Entity\EntityStorageException */ public static function updateVisibility(ContentEntityInterface $entity, array $new_options, array &$context): void { // Store some results for post-processing in the 'finished' callback. @@ -191,13 +188,13 @@ public static function getPostsFromGroup(GroupInterface $group): array { $query->addField('pst', 'entity_id'); $query->condition('pst.field_recipient_group_target_id', $group->id()); $result = $query->execute(); - if($result !== NULL) { + if ($result !== NULL) { $result->fetchAll(); } $post_result = $query->execute(); $post_keys = []; - if($post_result !== NULL) { + if ($post_result !== NULL) { $post_keys = $post_result->fetchAllAssoc('entity_id'); } diff --git a/modules/social_features/social_group/modules/social_group_invite/src/Form/SocialBulkGroupInvitation.php b/modules/social_features/social_group/modules/social_group_invite/src/Form/SocialBulkGroupInvitation.php index fb52dd7f412..32cf7c90418 100644 --- a/modules/social_features/social_group/modules/social_group_invite/src/Form/SocialBulkGroupInvitation.php +++ b/modules/social_features/social_group/modules/social_group_invite/src/Form/SocialBulkGroupInvitation.php @@ -2,8 +2,8 @@ namespace Drupal\social_group_invite\Form; +use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\File\FileUrlGenerator; @@ -570,7 +570,7 @@ public function extractEmailsFrom(string $string): mixed { * @return \Drupal\Core\Access\AccessResultInterface * The access results. */ - public function inviteAccess(GroupInterface $group): \Drupal\Core\Access\AccessResultInterface { + public function inviteAccess(GroupInterface $group): AccessResultInterface { // Allow for Group admin/managers. if ($group->hasPermission('administer members', $this->currentUser())) { return AccessResult::allowed(); diff --git a/modules/social_features/social_group/modules/social_group_invite/src/Plugin/Action/SocialGroupInviteResend.php b/modules/social_features/social_group/modules/social_group_invite/src/Plugin/Action/SocialGroupInviteResend.php index 14899f8d05f..06e8a972405 100644 --- a/modules/social_features/social_group/modules/social_group_invite/src/Plugin/Action/SocialGroupInviteResend.php +++ b/modules/social_features/social_group/modules/social_group_invite/src/Plugin/Action/SocialGroupInviteResend.php @@ -3,7 +3,6 @@ namespace Drupal\social_group_invite\Plugin\Action; use Drupal\Component\Datetime\TimeInterface; -use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\TempStore\SharedTempStore; @@ -95,7 +94,7 @@ public function execute(GroupRelationshipInterface $entity = NULL): void { return; } - /** @var AccountInterface $account */ + /** @var \Drupal\Core\Session\AccountInterface $account */ $account = $entity->getEntity(); $is_member = $entity->getGroup()->getMember($account); if (is_object($is_member)) { diff --git a/modules/social_features/social_group/modules/social_group_invite/src/SocialGroupInviteConfigOverride.php b/modules/social_features/social_group/modules/social_group_invite/src/SocialGroupInviteConfigOverride.php index 2d67a55cb42..6c6f01f6296 100644 --- a/modules/social_features/social_group/modules/social_group_invite/src/SocialGroupInviteConfigOverride.php +++ b/modules/social_features/social_group/modules/social_group_invite/src/SocialGroupInviteConfigOverride.php @@ -2,6 +2,7 @@ namespace Drupal\social_group_invite; +use Drupal\Core\Config\StorableConfigBase; use Drupal\Component\Utility\EmailValidatorInterface; use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Config\ConfigFactoryInterface; @@ -183,7 +184,7 @@ public function getCacheableMetadata($name): CacheableMetadata { * @return \Drupal\Core\Config\StorableConfigBase|null * The configuration object for the provided name and collection. */ - public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION): ?\Drupal\Core\Config\StorableConfigBase { + public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION): ?StorableConfigBase { return NULL; } diff --git a/modules/social_features/social_group/modules/social_group_request/src/Controller/GroupRequestController.php b/modules/social_features/social_group/modules/social_group_request/src/Controller/GroupRequestController.php index 6181929fdeb..0967520eebd 100644 --- a/modules/social_features/social_group/modules/social_group_request/src/Controller/GroupRequestController.php +++ b/modules/social_features/social_group/modules/social_group_request/src/Controller/GroupRequestController.php @@ -2,6 +2,7 @@ namespace Drupal\social_group_request\Controller; +use Symfony\Component\HttpFoundation\RedirectResponse; use Drupal\Core\Access\AccessResult; use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\Ajax\AjaxResponse; @@ -171,7 +172,7 @@ public function anonymousRequestMembership(GroupInterface $group): AjaxResponse /** * Callback to cancel the request of membership. */ - public function cancelRequest(GroupInterface $group): \Symfony\Component\HttpFoundation\RedirectResponse { + public function cancelRequest(GroupInterface $group): RedirectResponse { /** @var \Drupal\group\Entity\Storage\GroupRelationshipTypeStorageInterface $storage */ $storage = $this->entityTypeManager()->getStorage('group_content_type'); $group_type_id = (string) $group->getGroupType()->id(); diff --git a/modules/social_features/social_group/modules/social_group_welcome_message/social_group_welcome_message.module b/modules/social_features/social_group/modules/social_group_welcome_message/social_group_welcome_message.module index f6b33d672c1..ee3b92f4c2a 100644 --- a/modules/social_features/social_group/modules/social_group_welcome_message/social_group_welcome_message.module +++ b/modules/social_features/social_group/modules/social_group_welcome_message/social_group_welcome_message.module @@ -11,7 +11,6 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\group\Entity\GroupRelationshipInterface; use Drupal\group\Entity\GroupInterface; -use Drupal\private_message\Entity\PrivateMessageInterface; /** * Implements hook_entity_base_field_info(). @@ -196,7 +195,7 @@ function social_group_welcome_message_group_content_insert(GroupRelationshipInte $private_message_body = $group->get('private_message_body')->first()?->getValue(); // Create a single message with the pm body. - /** @var PrivateMessageInterface $private_message */ + /** @var \Drupal\private_message\Entity\PrivateMessageInterface $private_message */ $private_message = \Drupal::entityTypeManager()->getStorage('private_message')->create([ 'owner' => $owner, 'message' => $private_message_body, diff --git a/modules/social_features/social_group/src/CrossPostingService.php b/modules/social_features/social_group/src/CrossPostingService.php index 3aa2b5000a7..dcf7b1502ff 100644 --- a/modules/social_features/social_group/src/CrossPostingService.php +++ b/modules/social_features/social_group/src/CrossPostingService.php @@ -2,6 +2,7 @@ namespace Drupal\social_group; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Database\Connection; use Drupal\Core\Entity\ContentEntityInterface; use Drupal\group\Entity\GroupRelationshipInterface; @@ -42,7 +43,7 @@ class CrossPostingService { * * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected \Drupal\Core\Entity\EntityStorageInterface $groupStorage; + protected EntityStorageInterface $groupStorage; /** * Constructs a GroupRelationMultipleActivityEntityCondition object. diff --git a/modules/social_features/social_group/src/Form/SocialGroupSettings.php b/modules/social_features/social_group/src/Form/SocialGroupSettings.php index 99c855fa071..9ef89024e97 100644 --- a/modules/social_features/social_group/src/Form/SocialGroupSettings.php +++ b/modules/social_features/social_group/src/Form/SocialGroupSettings.php @@ -4,7 +4,6 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\ConfigFormBase; @@ -273,7 +272,7 @@ private function getCrossPostingEntityTypesOptions(): array { foreach ($content_types as $bundle) { $plugin_id = 'group_node:' . $bundle; if (in_array($plugin_id, $group_content_types)) { - /** @var EntityInterface $node_type */ + /** @var \Drupal\Core\Entity\EntityInterface $node_type */ $node_type = $this->entityTypeManager->getStorage('node_type')->load($bundle); $options[$bundle] = $node_type->label(); } diff --git a/modules/social_features/social_group/src/Plugin/Action/AddMembersToGroup.php b/modules/social_features/social_group/src/Plugin/Action/AddMembersToGroup.php index 3afe603bce1..748c23699d4 100644 --- a/modules/social_features/social_group/src/Plugin/Action/AddMembersToGroup.php +++ b/modules/social_features/social_group/src/Plugin/Action/AddMembersToGroup.php @@ -2,6 +2,8 @@ namespace Drupal\social_group\Plugin\Action; +use Drupal\Core\StringTranslation\TranslatableMarkup; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Access\AccessResult; use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; @@ -32,7 +34,7 @@ class AddMembersToGroup extends ViewsBulkOperationsActionBase implements Contain * * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected \Drupal\Core\Entity\EntityStorageInterface $storage; + protected EntityStorageInterface $storage; /** * Constructs a ViewsBulkOperationSendEmail object. @@ -72,7 +74,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function execute($entity = NULL): \Drupal\Core\StringTranslation\TranslatableMarkup { + public function execute($entity = NULL): TranslatableMarkup { // Load the Group. $group = $this->storage->load($this->configuration['groups']); diff --git a/modules/social_features/social_group/src/Plugin/Action/ChangeGroupMembershipRole.php b/modules/social_features/social_group/src/Plugin/Action/ChangeGroupMembershipRole.php index 1e314235a6a..c1d4a6f794a 100644 --- a/modules/social_features/social_group/src/Plugin/Action/ChangeGroupMembershipRole.php +++ b/modules/social_features/social_group/src/Plugin/Action/ChangeGroupMembershipRole.php @@ -2,6 +2,7 @@ namespace Drupal\social_group\Plugin\Action; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Access\AccessResult; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; @@ -82,7 +83,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function execute($entity = NULL): \Drupal\Core\StringTranslation\TranslatableMarkup { + public function execute($entity = NULL): TranslatableMarkup { $role = $this->configuration['role']; $is_member = $this->configuration['is_member']; $update = TRUE; diff --git a/modules/social_features/social_group/src/Plugin/Action/GroupContentEntityDeleteAction.php b/modules/social_features/social_group/src/Plugin/Action/GroupContentEntityDeleteAction.php index 1ad566a4df7..e29179dc52f 100644 --- a/modules/social_features/social_group/src/Plugin/Action/GroupContentEntityDeleteAction.php +++ b/modules/social_features/social_group/src/Plugin/Action/GroupContentEntityDeleteAction.php @@ -2,6 +2,7 @@ namespace Drupal\social_group\Plugin\Action; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\views_bulk_operations\Plugin\Action\EntityDeleteAction; /** @@ -19,7 +20,7 @@ class GroupContentEntityDeleteAction extends EntityDeleteAction { /** * {@inheritdoc} */ - public function execute($entity = NULL): \Drupal\Core\StringTranslation\TranslatableMarkup { + public function execute($entity = NULL): TranslatableMarkup { parent::execute($entity); return $this->t('Remove members from a group'); } diff --git a/modules/social_features/social_group/src/Plugin/Field/FieldWidget/SocialGroupSelectorWidget.php b/modules/social_features/social_group/src/Plugin/Field/FieldWidget/SocialGroupSelectorWidget.php index ed042889218..4f4f07413e8 100755 --- a/modules/social_features/social_group/src/Plugin/Field/FieldWidget/SocialGroupSelectorWidget.php +++ b/modules/social_features/social_group/src/Plugin/Field/FieldWidget/SocialGroupSelectorWidget.php @@ -13,7 +13,6 @@ use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Session\AccountProxyInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\group\Entity\GroupInterface; diff --git a/modules/social_features/social_landing_page/social_landing_page.module b/modules/social_features/social_landing_page/social_landing_page.module index 1cdbfda2403..a21ebb50345 100644 --- a/modules/social_features/social_landing_page/social_landing_page.module +++ b/modules/social_features/social_landing_page/social_landing_page.module @@ -5,6 +5,7 @@ * The Social landing page module. */ +use Drupal\Component\Render\MarkupInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Link; use Drupal\Core\StringTranslation\TranslatableMarkup; @@ -292,7 +293,7 @@ function social_landing_page_preprocess_field(array &$variables): void { * * @throws \Drupal\Core\Entity\EntityMalformedException */ -function _social_landing_page_get_hero_image(NodeInterface $node): \Drupal\Component\Render\MarkupInterface|array { +function _social_landing_page_get_hero_image(NodeInterface $node): MarkupInterface|array { // Must be a valid node. if ( $node->getType() !== 'landing_page' || diff --git a/modules/social_features/social_landing_page/src/Plugin/Field/FieldFormatter/BlockIdFormatter.php b/modules/social_features/social_landing_page/src/Plugin/Field/FieldFormatter/BlockIdFormatter.php index f35f28b9fcd..bbf0da7d463 100644 --- a/modules/social_features/social_landing_page/src/Plugin/Field/FieldFormatter/BlockIdFormatter.php +++ b/modules/social_features/social_landing_page/src/Plugin/Field/FieldFormatter/BlockIdFormatter.php @@ -4,7 +4,6 @@ use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FormatterBase; -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Session\AccountProxyInterface; use Drupal\Core\Render\RendererInterface; diff --git a/modules/social_features/social_like/src/Plugin/ActivityContext/VoteActivityContext.php b/modules/social_features/social_like/src/Plugin/ActivityContext/VoteActivityContext.php index 9f32bc68785..e9184bfcdf6 100644 --- a/modules/social_features/social_like/src/Plugin/ActivityContext/VoteActivityContext.php +++ b/modules/social_features/social_like/src/Plugin/ActivityContext/VoteActivityContext.php @@ -3,7 +3,6 @@ namespace Drupal\social_like\Plugin\ActivityContext; use Drupal\activity_creator\ActivityFactory; -use Drupal\activity_creator\Entity\Activity; use Drupal\activity_creator\Plugin\ActivityContextBase; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; @@ -113,7 +112,7 @@ public function getRecipients(array $data, int $last_id, int $limit): array { } } - /** @var Activity $entity */ + /** @var \Drupal\activity_creator\Entity\Activity $entity */ $uid = $entity->getOwnerId(); // Don't send notifications to myself. diff --git a/modules/social_features/social_node/src/SocialNodeForm.php b/modules/social_features/social_node/src/SocialNodeForm.php index 13450f77d4d..707ebb2f1e7 100644 --- a/modules/social_features/social_node/src/SocialNodeForm.php +++ b/modules/social_features/social_node/src/SocialNodeForm.php @@ -8,7 +8,6 @@ use Drupal\Core\Entity\EntityRepositoryInterface; use Drupal\Core\Entity\EntityTypeBundleInfoInterface; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Messenger\MessengerInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\TempStore\PrivateTempStoreFactory; use Drupal\node\NodeForm; @@ -117,7 +116,7 @@ public function validateForm(array &$form, FormStateInterface $form_state): Cont * @return \Drupal\social_node\Service\SocialNodeMessengerInterface * The messenger. */ - public function messenger(): \Drupal\social_node\Service\SocialNodeMessengerInterface { + public function messenger(): SocialNodeMessengerInterface { /** @var \Drupal\social_node\Service\SocialNodeMessengerInterface $messenger */ $messenger = $this->messenger; return $messenger; diff --git a/modules/social_features/social_post/modules/social_post_album/social_post_album.module b/modules/social_features/social_post/modules/social_post_album/social_post_album.module index d73c1325cc6..9c56c36b1c6 100644 --- a/modules/social_features/social_post/modules/social_post_album/social_post_album.module +++ b/modules/social_features/social_post/modules/social_post_album/social_post_album.module @@ -120,7 +120,7 @@ function social_post_album_preprocess_post__activity(array &$variables, string $ /** * Implements hook_preprocess_HOOK(). */ -function social_post_album_preprocess_block__social_post(array &$variables, string $hook): void { +function social_post_album_preprocess_block__social_post(array &$variables, string $hook): void { $variables['extra_stream_class'] = 'social-post-album--form'; } diff --git a/modules/social_features/social_post/modules/social_post_album/src/Element/SocialPostAlbumManagedFile.php b/modules/social_features/social_post/modules/social_post_album/src/Element/SocialPostAlbumManagedFile.php index eabf86e7cda..858b3c277d8 100644 --- a/modules/social_features/social_post/modules/social_post_album/src/Element/SocialPostAlbumManagedFile.php +++ b/modules/social_features/social_post/modules/social_post_album/src/Element/SocialPostAlbumManagedFile.php @@ -2,6 +2,7 @@ namespace Drupal\social_post_album\Element; +use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\InvokeCommand; use Drupal\Core\Form\FormStateInterface; use Drupal\file\Element\ManagedFile; @@ -22,7 +23,7 @@ class SocialPostAlbumManagedFile extends ManagedFile { /** * {@inheritdoc} */ - public static function uploadAjaxCallback(&$form, &$form_state, Request $request): \Drupal\Core\Ajax\AjaxResponse { + public static function uploadAjaxCallback(&$form, &$form_state, Request $request): AjaxResponse { $response = parent::uploadAjaxCallback($form, $form_state, $request); $element_parents = \Drupal::request()->request->get('element_parents'); // Either has a parent, or null if no parent, both are fine but can be diff --git a/modules/social_features/social_post/modules/social_post_album/src/Plugin/Field/FieldFormatter/AlbumImageFormatter.php b/modules/social_features/social_post/modules/social_post_album/src/Plugin/Field/FieldFormatter/AlbumImageFormatter.php index e8293e14534..4c7272d873f 100644 --- a/modules/social_features/social_post/modules/social_post_album/src/Plugin/Field/FieldFormatter/AlbumImageFormatter.php +++ b/modules/social_features/social_post/modules/social_post_album/src/Plugin/Field/FieldFormatter/AlbumImageFormatter.php @@ -2,7 +2,6 @@ namespace Drupal\social_post_album\Plugin\Field\FieldFormatter; -use Drupal\Core\Field\EntityReferenceFieldItemListInterface; use Drupal\Core\Field\FieldItemListInterface; use Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter; @@ -32,7 +31,7 @@ class AlbumImageFormatter extends ImageFormatter { */ public function viewElements(FieldItemListInterface $items, $langcode): array { // Grab all elements from the parent view. - /** @var EntityReferenceFieldItemListInterface $items */ + /** @var \Drupal\Core\Field\EntityReferenceFieldItemListInterface $items */ $elements = parent::viewElements($items, $langcode); if (!$items->isEmpty()) { // If it's only one, we can safely return without updating image styles. diff --git a/modules/social_features/social_post/post.page.inc b/modules/social_features/social_post/post.page.inc index 0ab7fb3229b..ee72dcdc6ad 100644 --- a/modules/social_features/social_post/post.page.inc +++ b/modules/social_features/social_post/post.page.inc @@ -7,6 +7,7 @@ * Page callback for Post entities. */ +use Drupal\Core\Datetime\FormattedDateDiff; use Drupal\Core\Render\Element; use Drupal\Core\Link; use Drupal\social_post\Entity\Post; @@ -37,7 +38,7 @@ function template_preprocess_post(array &$variables): void { 'granularity' => 1, 'return_as_object' => TRUE, ]); - if ($created_time_ago instanceof \Drupal\Core\Datetime\FormattedDateDiff) { + if ($created_time_ago instanceof FormattedDateDiff) { $created_time_ago = $created_time_ago->getString(); } $date = t('%time ago', ['%time' => $created_time_ago]); diff --git a/modules/social_features/social_post/social_post.admin.inc b/modules/social_features/social_post/social_post.admin.inc index 9329cac1a9b..5977d523084 100644 --- a/modules/social_features/social_post/social_post.admin.inc +++ b/modules/social_features/social_post/social_post.admin.inc @@ -68,7 +68,7 @@ function social_post_mass_update(array $posts, array $updates, ?string $langcode /** * Updates individual posts when fewer than 10 are queued. * - * @param PostInterface $post + * @param \Drupal\social_post\Entity\PostInterface $post * A post to update. * @param array $updates * Associative array of updates. @@ -76,7 +76,7 @@ function social_post_mass_update(array $posts, array $updates, ?string $langcode * (optional) The language updates should be applied to. If none is specified * all available languages are processed. * - * @return PostInterface + * @return \Drupal\social_post\Entity\PostInterface * An updated post object. * * @throws \Drupal\Core\Entity\EntityStorageException diff --git a/modules/social_features/social_post/social_post.module b/modules/social_features/social_post/social_post.module index 34678d5635b..9e3c496fbbb 100644 --- a/modules/social_features/social_post/social_post.module +++ b/modules/social_features/social_post/social_post.module @@ -5,6 +5,9 @@ * The Social post module. */ +use Drupal\Core\Session\AccountProxyInterface; +use Drupal\Core\Access\AccessResultInterface; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Session\AccountInterface; use Drupal\Component\Utility\UrlHelper; use Drupal\Component\Utility\Html; @@ -78,7 +81,7 @@ function _social_post_comment_post_comment_form_submit(array $form, FormStateInt * @return \Drupal\Core\StringTranslation\TranslatableMarkup|string * Post visibility detail. */ -function social_post_get_visibility_details(string $visibility, string $return_value = 'icon'): string|\Drupal\Core\StringTranslation\TranslatableMarkup { +function social_post_get_visibility_details(string $visibility, string $return_value = 'icon'): string|TranslatableMarkup { $return = &drupal_static(__FUNCTION__ . $visibility); @@ -240,7 +243,7 @@ function social_post_preprocess_field(array &$variables): void { /** * Implements hook_ENTITY_TYPE_create_access(). */ -function social_post_comment_create_access(AccountInterface $account, array $context, string $entity_bundle): \Drupal\Core\Access\AccessResultInterface { +function social_post_comment_create_access(AccountInterface $account, array $context, string $entity_bundle): AccessResultInterface { if ($entity_bundle === 'post_comment') { $group = \Drupal::routeMatch()->getParameter('group'); if (is_numeric($group)) { @@ -289,7 +292,7 @@ function social_post_user_cancel(array $edit, AccountInterface $account, string /** * Implements hook_ENTITY_TYPE_predelete(). */ -function social_post_user_predelete(\Drupal\Core\Session\AccountProxyInterface $account): void { +function social_post_user_predelete(AccountProxyInterface $account): void { // Delete posts. if ($account instanceof UserInterface) { $pids = \Drupal::entityQuery('post') diff --git a/modules/social_features/social_post/social_post.post_update.php b/modules/social_features/social_post/social_post.post_update.php index 47036d35612..9f6d47a83da 100644 --- a/modules/social_features/social_post/social_post.post_update.php +++ b/modules/social_features/social_post/social_post.post_update.php @@ -23,12 +23,12 @@ function social_post_post_update_remove_orphaned_posts(): void { ->fields('p', ['id']) ->condition('user_id', $user_query, 'NOT IN') ->execute(); - if ($result) { - $result = $result->fetchAll(); - } + if ($result) { + $result = $result->fetchAll(); + } $pids = []; - /** @var array $result */ + /** @var array $result */ foreach ($result as $row) { $pids[] = $row->id; } diff --git a/modules/social_features/social_post/src/Entity/Post.php b/modules/social_features/social_post/src/Entity/Post.php index 4e656a6f609..e809ba6f136 100644 --- a/modules/social_features/social_post/src/Entity/Post.php +++ b/modules/social_features/social_post/src/Entity/Post.php @@ -2,6 +2,8 @@ namespace Drupal\social_post\Entity; +use Drupal\Core\StringTranslation\TranslatableMarkup; +use Drupal\user\EntityOwnerInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Entity\ContentEntityBase; @@ -111,7 +113,7 @@ public function getOwnerId(): ?int { /** * {@inheritdoc} */ - public function setOwnerId($uid): \Drupal\user\EntityOwnerInterface|Post|static { + public function setOwnerId($uid): EntityOwnerInterface|Post|static { $this->set('user_id', $uid); return $this; } @@ -119,7 +121,7 @@ public function setOwnerId($uid): \Drupal\user\EntityOwnerInterface|Post|static /** * {@inheritdoc} */ - public function setOwner(UserInterface $account): \Drupal\user\EntityOwnerInterface|Post|static { + public function setOwner(UserInterface $account): EntityOwnerInterface|Post|static { $this->set('user_id', $account->id()); return $this; } @@ -157,7 +159,7 @@ public function setType($type): PostInterface|Post|static { /** * {@inheritdoc} */ - public function getDisplayName(): \Drupal\Core\StringTranslation\TranslatableMarkup { + public function getDisplayName(): TranslatableMarkup { if ($this->hasField('field_post_image') && !$this->get('field_post_image') ->isEmpty()) { return $this->t('photo'); diff --git a/modules/social_features/social_post/src/Form/PostForm.php b/modules/social_features/social_post/src/Form/PostForm.php index 8d77da33fdf..48562e48656 100644 --- a/modules/social_features/social_post/src/Form/PostForm.php +++ b/modules/social_features/social_post/src/Form/PostForm.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityTypeBundleInfoInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Session\AccountInterface; -use Drupal\dynamic_entity_reference\Plugin\DataType\DynamicEntityReference; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -191,7 +190,7 @@ protected function configureVisibilityField(array &$form, FormStateInterface $fo // for user posts. else { if ($this->operation === 'edit' && $this->entity->hasField('field_recipient_group') && !$this->entity->get('field_recipient_group')->isEmpty()) { - /** @var DynamicEntityReference $field_recipient_group */ + /** @var \Drupal\dynamic_entity_reference\Plugin\DataType\DynamicEntityReference $field_recipient_group */ $field_recipient_group = $this->entity->get('field_recipient_group')->first()?->get('entity'); $current_group = $field_recipient_group->getTarget()?->getValue(); } diff --git a/modules/social_features/social_post/src/Form/PostTypeDeleteForm.php b/modules/social_features/social_post/src/Form/PostTypeDeleteForm.php index c6a09df0a06..db111f3904c 100644 --- a/modules/social_features/social_post/src/Form/PostTypeDeleteForm.php +++ b/modules/social_features/social_post/src/Form/PostTypeDeleteForm.php @@ -2,6 +2,7 @@ namespace Drupal\social_post\Form; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; @@ -14,7 +15,7 @@ class PostTypeDeleteForm extends EntityConfirmFormBase { /** * {@inheritdoc} */ - public function getQuestion(): \Drupal\Core\StringTranslation\TranslatableMarkup { + public function getQuestion(): TranslatableMarkup { return $this->t('Are you sure you want to delete %name?', ['%name' => $this->entity->label()]); } @@ -28,7 +29,7 @@ public function getCancelUrl(): Url { /** * {@inheritdoc} */ - public function getConfirmText(): \Drupal\Core\StringTranslation\TranslatableMarkup { + public function getConfirmText(): TranslatableMarkup { return $this->t('Delete'); } diff --git a/modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php b/modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php index 97c2a7c52a0..e59df29b211 100644 --- a/modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php +++ b/modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php @@ -2,6 +2,7 @@ namespace Drupal\social_post\Plugin\views\area; +use Drupal\Core\Block\BlockPluginInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\views\Plugin\views\area\AreaPluginBase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -128,7 +129,7 @@ public function render($empty = FALSE): ?array { /** * {@inheritdoc} */ - protected function getBlock(): ?\Drupal\Core\Block\BlockPluginInterface { + protected function getBlock(): ?BlockPluginInterface { if (empty($this->options['block_id'])) { return NULL; } diff --git a/modules/social_features/social_post/src/PostAccessControlHandler.php b/modules/social_features/social_post/src/PostAccessControlHandler.php index 77908fb2589..eddc4da40e5 100644 --- a/modules/social_features/social_post/src/PostAccessControlHandler.php +++ b/modules/social_features/social_post/src/PostAccessControlHandler.php @@ -11,7 +11,6 @@ use Drupal\Core\Session\AccountInterface; use Drupal\Core\Access\AccessResult; use Drupal\group\Entity\GroupInterface; -use Drupal\group\Entity\Storage\GroupRoleStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -126,7 +125,7 @@ protected function checkAccess(EntityInterface $entity, $operation, AccountInter } } - /** @var GroupRoleStorageInterface $group_role_storage */ + /** @var \Drupal\group\Entity\Storage\GroupRoleStorageInterface $group_role_storage */ $group_role_storage = $this->entityTypeManager->getStorage('group_role'); $group_roles = $group_role_storage->loadByUserAndGroup($account, $group); foreach ($group_roles as $group_role) { diff --git a/modules/social_features/social_post/src/PostHtmlRouteProvider.php b/modules/social_features/social_post/src/PostHtmlRouteProvider.php index dd3bb33a67c..0b0bfa384a5 100644 --- a/modules/social_features/social_post/src/PostHtmlRouteProvider.php +++ b/modules/social_features/social_post/src/PostHtmlRouteProvider.php @@ -2,6 +2,7 @@ namespace Drupal\social_post; +use Symfony\Component\Routing\RouteCollection; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\Routing\AdminHtmlRouteProvider; use Symfony\Component\Routing\Route; @@ -17,7 +18,7 @@ class PostHtmlRouteProvider extends AdminHtmlRouteProvider { /** * {@inheritdoc} */ - public function getRoutes(EntityTypeInterface $entity_type): array|\Symfony\Component\Routing\RouteCollection { + public function getRoutes(EntityTypeInterface $entity_type): array|RouteCollection { $collection = parent::getRoutes($entity_type); $entity_type_id = $entity_type->id(); diff --git a/modules/social_features/social_post/src/PostViewBuilder.php b/modules/social_features/social_post/src/PostViewBuilder.php index 00f8113a4ab..19d4bbbba87 100644 --- a/modules/social_features/social_post/src/PostViewBuilder.php +++ b/modules/social_features/social_post/src/PostViewBuilder.php @@ -3,9 +3,7 @@ namespace Drupal\social_post; use Drupal\Core\Database\Connection; -use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\EntityDisplayRepositoryInterface; -use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityViewBuilder; use Drupal\Core\Language\LanguageManagerInterface; @@ -13,13 +11,10 @@ use Drupal\Core\Render\Element\Link; use Drupal\Core\Theme\Registry; use Drupal\group\Entity\Group; -use Drupal\group\Entity\GroupInterface; use Drupal\message\Entity\MessageTemplate; use Drupal\social_group\SocialGroupHelperService; use Drupal\social_post\Entity\Post; -use Drupal\social_post\Entity\PostInterface; use Drupal\user\Entity\User; -use League\OAuth2\Server\Entities\UserEntityInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -30,7 +25,7 @@ class PostViewBuilder extends EntityViewBuilder { /** * {@inheritdoc} */ - public static function trustedCallbacks() { + public static function trustedCallbacks(): array { return [ 'build', 'buildMultiple', @@ -43,7 +38,7 @@ public static function trustedCallbacks() { * * @var \Drupal\social_group\SocialGroupHelperService */ - protected $socialGroupHelperService; + protected SocialGroupHelperService $socialGroupHelperService; /** * The database service. @@ -52,7 +47,6 @@ public static function trustedCallbacks() { */ private Connection $database; - /** * Constructs a new EntityViewBuilder. * @@ -68,6 +62,8 @@ public static function trustedCallbacks() { * The entity display repository. * @param \Drupal\social_group\SocialGroupHelperService $social_group_helper_service * The social group helper service. + * @param \Drupal\Core\Database\Connection $database + * The database service. */ public function __construct( EntityTypeInterface $entity_type, @@ -153,7 +149,7 @@ public function buildComponents(array &$build, array $entities, array $displays, if (!(in_array($template_id, $template_ids) && in_array($template_id, $template_types))) { continue; } - /** @var PostInterface $entity + /** @var \Drupal\social_post\Entity\PostInterface $entity */ $account = $entity->getOwner(); @@ -172,7 +168,7 @@ public function buildComponents(array &$build, array $entities, array $displays, continue; } - /** @var GroupInterface $group */ + /** @var \Drupal\group\Entity\GroupInterface $group */ $group = Group::load($group_id); $replacements['[message:gurl]'] = $group->toLink()->getUrl()->toString(); @@ -192,7 +188,7 @@ public function buildComponents(array &$build, array $entities, array $displays, $result = $query->execute(); if ($result) { $user_id = $result->fetchField(); - /** @var User $account */ + /** @var \Drupal\user\Entity\User $account */ $account = User::load($user_id); $replacements['[message:recipient-user-url]'] = $account->toLink()->getUrl()->toString(); diff --git a/modules/social_features/social_private_message/social_private_message.module b/modules/social_features/social_private_message/social_private_message.module index 6e8fb0be44e..5cf718931e3 100644 --- a/modules/social_features/social_private_message/social_private_message.module +++ b/modules/social_features/social_private_message/social_private_message.module @@ -670,7 +670,7 @@ function social_private_message_private_message_thread_access(PrivateMessageThre /** * Implements hook_private_message_create_access(). */ -function social_private_message_private_message_create_access(AccountInterface $account, array $context, string $entity_bundle): \Drupal\Core\Access\AccessResultInterface { +function social_private_message_private_message_create_access(AccountInterface $account, array $context, string $entity_bundle): AccessResultInterface { return AccessResult::forbiddenIf(!($account->hasPermission('use private messaging system') && $account->hasPermission('create private messages thread'))); } diff --git a/modules/social_features/social_private_message/src/Plugin/EntityReferenceSelection/UserSelection.php b/modules/social_features/social_private_message/src/Plugin/EntityReferenceSelection/UserSelection.php index c4859214bdd..6238f70a57c 100644 --- a/modules/social_features/social_private_message/src/Plugin/EntityReferenceSelection/UserSelection.php +++ b/modules/social_features/social_private_message/src/Plugin/EntityReferenceSelection/UserSelection.php @@ -2,6 +2,7 @@ namespace Drupal\social_private_message\Plugin\EntityReferenceSelection; +use Drupal\Core\Entity\Query\QueryInterface; use Drupal\social_profile\Plugin\EntityReferenceSelection\UserSelection as UserSelectionBase; use Drupal\user\RoleInterface; @@ -21,13 +22,13 @@ class UserSelection extends UserSelectionBase { /** * {@inheritdoc} */ - protected function buildEntityQuery(mixed $match = NULL, $match_operator = 'CONTAINS', array $ids = []): \Drupal\Core\Entity\Query\QueryInterface { + protected function buildEntityQuery(mixed $match = NULL, $match_operator = 'CONTAINS', array $ids = []): QueryInterface { /** @var \Drupal\user\RoleStorageInterface $role_storage */ $role_storage = $this->entityTypeManager->getStorage('user_role'); // Continue if authenticated users has permission to view private messages. $authenticated_role = $role_storage->load(RoleInterface::AUTHENTICATED_ID); - if ($authenticated_role!== NULL && $authenticated_role->hasPermission('use private messaging system')) { + if ($authenticated_role !== NULL && $authenticated_role->hasPermission('use private messaging system')) { return parent::buildEntityQuery($match, $match_operator, $ids); } diff --git a/modules/social_features/social_private_message/src/Plugin/UserExportPlugin/UserAnalyticsPrivateMessage.php b/modules/social_features/social_private_message/src/Plugin/UserExportPlugin/UserAnalyticsPrivateMessage.php index 92d3b64b263..00ab504ea65 100644 --- a/modules/social_features/social_private_message/src/Plugin/UserExportPlugin/UserAnalyticsPrivateMessage.php +++ b/modules/social_features/social_private_message/src/Plugin/UserExportPlugin/UserAnalyticsPrivateMessage.php @@ -2,6 +2,7 @@ namespace Drupal\social_private_message\Plugin\UserExportPlugin; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Entity\ContentEntityStorageInterface; use Drupal\social_user_export\Plugin\UserExportPluginBase; use Drupal\user\UserInterface; @@ -20,7 +21,7 @@ class UserAnalyticsPrivateMessage extends UserExportPluginBase { /** * {@inheritdoc} */ - public function getHeader(): string|\Drupal\Core\StringTranslation\TranslatableMarkup { + public function getHeader(): string|TranslatableMarkup { return $this->t('Number of Private messages'); } diff --git a/modules/social_features/social_profile/modules/social_profile_fields/social_profile_fields.module b/modules/social_features/social_profile/modules/social_profile_fields/social_profile_fields.module index 5b767a23b8f..b816959d0a9 100644 --- a/modules/social_features/social_profile/modules/social_profile_fields/social_profile_fields.module +++ b/modules/social_features/social_profile/modules/social_profile_fields/social_profile_fields.module @@ -5,6 +5,7 @@ * The social profile fields module file. */ +use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\Access\AccessResult; use Drupal\Core\Entity\ContentEntityFormInterface; use Drupal\Core\Entity\Display\EntityFormDisplayInterface; @@ -23,7 +24,7 @@ use Drupal\profile\Entity\ProfileType; /** * Implements hook_entity_field_access(). */ -function social_profile_fields_entity_field_access(string $operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL): \Drupal\Core\Access\AccessResultInterface { +function social_profile_fields_entity_field_access(string $operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL): AccessResultInterface { // By default, we return Switzerland. $access_result = AccessResult::neutral(); @@ -109,7 +110,7 @@ function social_profile_fields_form_alter(array &$form, FormStateInterface $form /** * Implements hook_form_FORM_ID_alter(). */ -function social_profile_fields_form_profile_profile_edit_form_alter(array&$form, FormStateInterface $form_state): void { +function social_profile_fields_form_profile_profile_edit_form_alter(array &$form, FormStateInterface $form_state): void { /** @var \Drupal\Core\Entity\ContentEntityFormInterface $form_object */ $form_object = $form_state->getFormObject(); /** @var \Drupal\profile\Entity\ProfileInterface $form_entity */ diff --git a/modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsSettingsForm.php b/modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsSettingsForm.php index c5772111656..ffdda538405 100644 --- a/modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsSettingsForm.php +++ b/modules/social_features/social_profile/modules/social_profile_fields/src/Form/SocialProfileFieldsSettingsForm.php @@ -5,7 +5,6 @@ use Drupal\Core\Cache\CacheTagsInvalidator; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Database\Connection; -use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Entity\EntityFieldManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; diff --git a/modules/social_features/social_profile/modules/social_profile_fields/src/SocialProfileFieldsBatch.php b/modules/social_features/social_profile/modules/social_profile_fields/src/SocialProfileFieldsBatch.php index 7d43caddf82..297a58d37a9 100644 --- a/modules/social_features/social_profile/modules/social_profile_fields/src/SocialProfileFieldsBatch.php +++ b/modules/social_features/social_profile/modules/social_profile_fields/src/SocialProfileFieldsBatch.php @@ -25,7 +25,8 @@ class SocialProfileFieldsBatch { * @param array $context * The context of the flush. * - * @throws \Drupal\Core\Entity\EntityStorageException|\Drupal\Core\TypedData\Exception\ReadOnlyException + * @throws \Drupal\Core\Entity\EntityStorageException + * @throws \Drupal\Core\TypedData\Exception\ReadOnlyException */ public static function performFlush(array $pids, array $fields, array &$context): void { $message = 'Flushing profile data...'; diff --git a/modules/social_features/social_profile/modules/social_profile_organization_tag/social_profile_organization_tag.module b/modules/social_features/social_profile/modules/social_profile_organization_tag/social_profile_organization_tag.module index 9e04d1be516..744d91118e3 100644 --- a/modules/social_features/social_profile/modules/social_profile_organization_tag/social_profile_organization_tag.module +++ b/modules/social_features/social_profile/modules/social_profile_organization_tag/social_profile_organization_tag.module @@ -5,7 +5,6 @@ * The Social profile organization tag module. */ -use Drupal\Core\Field\EntityReferenceFieldItemListInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Component\Render\FormattableMarkup; use Drupal\Core\Render\BubbleableMetadata; @@ -102,7 +101,7 @@ function social_profile_organization_tag_tokens_alter(array &$replacements, arra */ function social_profile_organization_tag_fetch(Profile $profile, bool $return_html = TRUE): FormattableMarkup { if (!$profile->get('field_profile_organization_tag')->isEmpty()) { - /** @var EntityReferenceFieldItemListInterface $organization_tag */ + /** @var \Drupal\Core\Field\EntityReferenceFieldItemListInterface $organization_tag */ $organization_tag = $profile->get('field_profile_organization_tag'); $organization_tag_entities = $organization_tag->referencedEntities(); if (count($organization_tag_entities) === 1) { diff --git a/modules/social_features/social_profile/modules/social_profile_privacy/social_profile_privacy.module b/modules/social_features/social_profile/modules/social_profile_privacy/social_profile_privacy.module index 431cd20ef59..1c51c809b78 100644 --- a/modules/social_features/social_profile/modules/social_profile_privacy/social_profile_privacy.module +++ b/modules/social_features/social_profile/modules/social_profile_privacy/social_profile_privacy.module @@ -405,7 +405,7 @@ function social_profile_privacy_entity_field_access(string $operation, FieldDefi // If owner. $access = ($uid === $account->id()); // If field is not hidden. - $access = $access || !in_array($field_definition->getName(), $fields, true); + $access = $access || !in_array($field_definition->getName(), $fields, TRUE); // If user has access to view hidden fields. $access = $access || $account->hasPermission('social profile privacy view hidden fields'); diff --git a/modules/social_features/social_profile/social_profile.module b/modules/social_features/social_profile/social_profile.module index 70085eccb8d..1df53b157ab 100644 --- a/modules/social_features/social_profile/social_profile.module +++ b/modules/social_features/social_profile/social_profile.module @@ -431,9 +431,6 @@ function social_profile_preprocess_profile(array &$variables): void { !empty($profile->get('field_profile_banner_image')->entity) && $profile->get('field_profile_banner_image')->access('view') ) { - // $variables['profile_hero_styled_image_url'] = ImageStyle::load('social_xx_large') - // ?->buildUrl($profile->get('field_profile_banner_image')->entity->getFileUri()); - /** @var \Drupal\file\Entity\File $file */ $file = $profile->get('field_profile_banner_image')->entity; $variables['profile_hero_styled_image_url'] = ImageStyle::load('social_xx_large')?->buildUrl((string) $file->getFileUri()); diff --git a/modules/social_features/social_profile/src/Plugin/EntityReferenceSelection/UserSelection.php b/modules/social_features/social_profile/src/Plugin/EntityReferenceSelection/UserSelection.php index 5110af4aa58..19df404c144 100644 --- a/modules/social_features/social_profile/src/Plugin/EntityReferenceSelection/UserSelection.php +++ b/modules/social_features/social_profile/src/Plugin/EntityReferenceSelection/UserSelection.php @@ -2,7 +2,7 @@ namespace Drupal\social_profile\Plugin\EntityReferenceSelection; -use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Core\Entity\Query\QueryInterface; use Drupal\social_profile\SocialProfileTrait; use Drupal\user\Plugin\EntityReferenceSelection\UserSelection as UserSelectionBase; @@ -37,7 +37,7 @@ public function validateReferenceableEntities(array $ids): int|array { $result = []; if ($ids) { $target_type = $this->configuration['target_type']; - /** @var EntityTypeInterface $entity_type */ + /** @var \Drupal\Core\Entity\EntityTypeInterface $entity_type */ $entity_type = $this->entityTypeManager->getDefinition($target_type); $query = $this->buildEntityQuery(NULL, 'CONTAINS', $ids); $id = $entity_type->getKey('id'); @@ -66,7 +66,7 @@ public function validateReferenceableEntities(array $ids): int|array { * The EntityQuery object with the basic conditions and sorting applied to * it. */ - protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS', array $ids = []): \Drupal\Core\Entity\Query\QueryInterface { + protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS', array $ids = []): QueryInterface { // If an earlier request already had the ids don't query them again. if (empty($ids)) { $config_factory = \Drupal::service('config.factory'); diff --git a/modules/social_features/social_profile/src/Plugin/views/field/ProfileEntitySortable.php b/modules/social_features/social_profile/src/Plugin/views/field/ProfileEntitySortable.php index df14226a0a2..0778869b408 100644 --- a/modules/social_features/social_profile/src/Plugin/views/field/ProfileEntitySortable.php +++ b/modules/social_features/social_profile/src/Plugin/views/field/ProfileEntitySortable.php @@ -9,7 +9,6 @@ use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Session\AccountInterface; use Drupal\views\Plugin\views\field\RenderedEntity; -use Drupal\views\Plugin\views\query\Sql; use Drupal\views\Plugin\ViewsHandlerManager; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -43,7 +42,11 @@ class ProfileEntitySortable extends RenderedEntity { */ protected AccountInterface $currentUser; - /** @var Sql */ + /** + * The sql query object. + * + * @var \Drupal\views\Plugin\views\query\Sql + */ public $query; /** diff --git a/modules/social_features/social_search/src/Form/SearchContentForm.php b/modules/social_features/social_search/src/Form/SearchContentForm.php index 57a6d6e4925..c9f4246ed3d 100644 --- a/modules/social_features/social_search/src/Form/SearchContentForm.php +++ b/modules/social_features/social_search/src/Form/SearchContentForm.php @@ -3,7 +3,6 @@ namespace Drupal\social_search\Form; use Drupal\Component\Utility\Xss; -use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; diff --git a/modules/social_features/social_search/src/Form/SearchHeroForm.php b/modules/social_features/social_search/src/Form/SearchHeroForm.php index 443b3127d97..ad21ecf9eca 100644 --- a/modules/social_features/social_search/src/Form/SearchHeroForm.php +++ b/modules/social_features/social_search/src/Form/SearchHeroForm.php @@ -3,7 +3,6 @@ namespace Drupal\social_search\Form; use Drupal\Component\Utility\Xss; -use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RouteMatchInterface; diff --git a/modules/social_features/social_sharing/social_sharing.module b/modules/social_features/social_sharing/social_sharing.module index 7e914d1cee5..4e3d6474b7a 100644 --- a/modules/social_features/social_sharing/social_sharing.module +++ b/modules/social_features/social_sharing/social_sharing.module @@ -15,7 +15,7 @@ use Drupal\Core\Access\AccessResult; /** * Implements hook_block_access(). */ -function social_sharing_block_access(Block $block, string$operation, AccountInterface $account): AccessResultInterface { +function social_sharing_block_access(Block $block, string $operation, AccountInterface $account): AccessResultInterface { if ($operation === 'view' && $block->getPluginId() === 'shariff_block') { // Exclude Social Sharing block form Add and Edit node pages. diff --git a/modules/social_features/social_swiftmail/src/Plugin/EmailAdjuster/Reroute.php b/modules/social_features/social_swiftmail/src/Plugin/EmailAdjuster/Reroute.php index 91e9b395c1b..3c35eb04b6a 100644 --- a/modules/social_features/social_swiftmail/src/Plugin/EmailAdjuster/Reroute.php +++ b/modules/social_features/social_swiftmail/src/Plugin/EmailAdjuster/Reroute.php @@ -14,7 +14,6 @@ use Drupal\user\RoleStorageInterface; use Drupal\Component\Utility\EmailValidatorInterface; use Drupal\Core\Security\TrustedCallbackInterface; -use Symfony\Component\Mime\Header\HeaderInterface; /** * Defines the Reroute Email Adjuster. @@ -250,7 +249,7 @@ public function preRender(EmailInterface $email): void { // Add Cc/Bcc values to the message only if they are set. $headers = $email->getHeaders(); - /** @var HeaderInterface $header */ + /** @var \Symfony\Component\Mime\Header\HeaderInterface $header */ $header = $headers->get('X-Rerouted-Original-cc'); if ($header !== NULL) { $message_lines[] = $this->t('Originally cc: @cc', [ diff --git a/modules/social_features/social_tagging/src/Form/SocialTaggingSettingsForm.php b/modules/social_features/social_tagging/src/Form/SocialTaggingSettingsForm.php index 2e98edba449..d61440f2e21 100644 --- a/modules/social_features/social_tagging/src/Form/SocialTaggingSettingsForm.php +++ b/modules/social_features/social_tagging/src/Form/SocialTaggingSettingsForm.php @@ -4,7 +4,6 @@ use Drupal\Core\Cache\CacheTagsInvalidatorInterface; use Drupal\Core\Database\Connection; -use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\ConfigFormBase; diff --git a/modules/social_features/social_tagging/src/Plugin/ContentExportPlugin/ContentTags.php b/modules/social_features/social_tagging/src/Plugin/ContentExportPlugin/ContentTags.php index cd468550533..356f8a053cd 100644 --- a/modules/social_features/social_tagging/src/Plugin/ContentExportPlugin/ContentTags.php +++ b/modules/social_features/social_tagging/src/Plugin/ContentExportPlugin/ContentTags.php @@ -54,7 +54,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition /** * The create method. * - * @param ContainerInterface $container + * @param \Symfony\Component\DependencyInjection\ContainerInterface $container * Container interface. * @param array $configuration * An array of configuration. @@ -63,7 +63,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition * @param mixed $plugin_definition * The plugin definition. * - * @return ContentTags Returns the ContentTags plugin. + * @return ContentTags * Returns the ContentTags plugin. */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): self { diff --git a/modules/social_features/social_topic/social_topic.module b/modules/social_features/social_topic/social_topic.module index 5c3e40a8dcd..c628652932b 100644 --- a/modules/social_features/social_topic/social_topic.module +++ b/modules/social_features/social_topic/social_topic.module @@ -5,6 +5,7 @@ * The Social topic module. */ +use Drupal\Core\Access\AccessResultForbidden; use Drupal\block\Entity\Block; use Drupal\Core\Access\AccessResult; use Drupal\Core\Access\AccessResultNeutral; @@ -300,7 +301,7 @@ function social_topic_widget_alter(array &$form): void { * * Implements hook_block_access(). */ -function social_topic_block_access(Block $block, string $operation, AccountInterface $account): \Drupal\Core\Access\AccessResultForbidden|AccessResultNeutral|AccessResult { +function social_topic_block_access(Block $block, string $operation, AccountInterface $account): AccessResultForbidden|AccessResultNeutral|AccessResult { if ($operation === 'view' && ($block->getPluginId() === 'views_exposed_filter_block:topics-page_profile' || $block->getPluginId() === 'views_block:topics-block_user_topics')) { // Here we're going to assume by default access is not granted. diff --git a/modules/social_features/social_user/social_user.post_update.php b/modules/social_features/social_user/social_user.post_update.php index 9538b2cde5a..7bfa54a2a3e 100644 --- a/modules/social_features/social_user/social_user.post_update.php +++ b/modules/social_features/social_user/social_user.post_update.php @@ -65,6 +65,5 @@ function social_user_post_update_10101_add_verified_role_to_existing_users(array ? 1 : (((int) $sandbox['count']) - count($sandbox['ids'])) / ((int) $sandbox['count']); - return (bool) $sandbox['#finished']; } diff --git a/modules/social_features/social_user/src/EdaHandler.php b/modules/social_features/social_user/src/EdaHandler.php index 61ab0319e55..5c70edbd59c 100644 --- a/modules/social_features/social_user/src/EdaHandler.php +++ b/modules/social_features/social_user/src/EdaHandler.php @@ -354,6 +354,7 @@ private function dispatch(string $topic_name, string $event_type, UserInterface } // Build the event. + /** @var \CloudEvents\CloudEventInterface $event */ $event = $this->fromEntity($user, $event_type); // Dispatch to message broker. diff --git a/modules/social_features/social_user/src/Form/SocialUserNavigationSettingsForm.php b/modules/social_features/social_user/src/Form/SocialUserNavigationSettingsForm.php index 669e8e3a064..a96322382cf 100644 --- a/modules/social_features/social_user/src/Form/SocialUserNavigationSettingsForm.php +++ b/modules/social_features/social_user/src/Form/SocialUserNavigationSettingsForm.php @@ -3,7 +3,6 @@ namespace Drupal\social_user\Form; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; diff --git a/modules/social_features/social_user/src/Plugin/Action/SocialAddRoleUser.php b/modules/social_features/social_user/src/Plugin/Action/SocialAddRoleUser.php index 02fe53e3e2e..0fb2c37086a 100644 --- a/modules/social_features/social_user/src/Plugin/Action/SocialAddRoleUser.php +++ b/modules/social_features/social_user/src/Plugin/Action/SocialAddRoleUser.php @@ -4,14 +4,10 @@ use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\Core\Session\AccountProxy; use Drupal\Core\Session\AccountProxyInterface; use Drupal\role_delegation\DelegatableRolesInterface; -use Drupal\user\Entity\User; use Drupal\user\Plugin\Action\ChangeUserRoleBase; use Drupal\user\RoleInterface; -use Drupal\user\UserInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -23,7 +19,7 @@ * type = "social_user" * ) */ -class SocialAddRoleUser extends ChangeUserRoleBase{ +class SocialAddRoleUser extends ChangeUserRoleBase { /** * The account proxy interface. @@ -66,7 +62,7 @@ public static function create(ContainerInterface $container, array $configuratio public function execute(AccountProxyInterface $account = NULL): void { $rid = $this->configuration['rid']; // Skip adding the role to the user if they already have it. - /** @var User $account */ + /** @var \Drupal\user\Entity\User $account */ if ($account !== NULL && !$account->hasRole($rid)) { // For efficiency manually save the original account before applying // any changes. diff --git a/modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php b/modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php index 34e1ee1d9d6..d2b741d9a28 100644 --- a/modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php +++ b/modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php @@ -2,6 +2,7 @@ namespace Drupal\social_user\Plugin\Action; +use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\Action\ActionBase; use Drupal\Core\Session\AccountInterface; use Drupal\user\UserInterface; @@ -36,7 +37,7 @@ public function execute(?UserInterface $account = NULL): void { /** * {@inheritdoc} */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE): bool|int|\Drupal\Core\Access\AccessResultInterface { + public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE): bool|int|AccessResultInterface { /** @var \Drupal\user\UserInterface $object */ $access = $object->get('status')->access('edit', $account, TRUE) ->andIf($object->access('update', $account, TRUE)); diff --git a/modules/social_features/social_user/src/Plugin/Action/SocialRemoveRoleUser.php b/modules/social_features/social_user/src/Plugin/Action/SocialRemoveRoleUser.php index d4c796ed279..30d0c79520d 100644 --- a/modules/social_features/social_user/src/Plugin/Action/SocialRemoveRoleUser.php +++ b/modules/social_features/social_user/src/Plugin/Action/SocialRemoveRoleUser.php @@ -4,8 +4,6 @@ use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\Core\Session\AccountProxy; use Drupal\Core\Session\AccountProxyInterface; use Drupal\role_delegation\DelegatableRolesInterface; use Drupal\user\Plugin\Action\ChangeUserRoleBase; @@ -64,7 +62,7 @@ public static function create(ContainerInterface $container, array $configuratio public function execute(AccountProxyInterface $account = NULL): void { $rid = $this->configuration['rid']; // Skip removing the role from the user if they already don't have it. - /** @var AccountProxy $account */ + /** @var \Drupal\Core\Session\AccountProxy $account */ if ($account !== NULL && $account->hasRole($rid)) { // For efficiency manually save the original account before applying // any changes. diff --git a/modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php b/modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php index 278e26ab7db..0509fc37573 100644 --- a/modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php +++ b/modules/social_features/social_user/src/Plugin/Action/SocialSendEmail.php @@ -11,8 +11,6 @@ use Drupal\Core\Session\AccountInterface; use Drupal\Core\Site\Settings; use Drupal\Core\Utility\Token; -use Drupal\social_queue_storage\Entity\QueueStorageEntity; -use Drupal\social_user\Entity\User; use Drupal\user\UserInterface; use Drupal\views_bulk_operations\Action\ViewsBulkOperationsActionBase; use Drupal\views_bulk_operations\Action\ViewsBulkOperationsPreconfigurationInterface; @@ -314,7 +312,7 @@ public function submitConfigurationForm(array &$form, FormStateInterface $form_s $form_state->cleanValues(); // Get the queue storage entity and create a new entry. $queue_storage = $this->entityTypeManager->getStorage('queue_storage_entity'); - /** @var QueueStorageEntity $entity */ + /** @var \Drupal\social_queue_storage\Entity\QueueStorageEntity $entity */ $entity = $queue_storage->create([ 'name' => 'user_email_queue', 'type' => 'email', diff --git a/modules/social_features/social_user/src/Plugin/GraphQL/SchemaExtension/UserSchemaExtension.php b/modules/social_features/social_user/src/Plugin/GraphQL/SchemaExtension/UserSchemaExtension.php index 475750107cc..79fecf62174 100644 --- a/modules/social_features/social_user/src/Plugin/GraphQL/SchemaExtension/UserSchemaExtension.php +++ b/modules/social_features/social_user/src/Plugin/GraphQL/SchemaExtension/UserSchemaExtension.php @@ -4,7 +4,6 @@ use Drupal\graphql\GraphQL\ResolverBuilder; use Drupal\graphql\GraphQL\ResolverRegistryInterface; -use Drupal\social_graphql\GraphQL\DecoratableTypeResolver; use Drupal\social_graphql\Plugin\GraphQL\SchemaExtension\SchemaExtensionPluginBase; use Drupal\social_user\GraphQL\UserActorTypeResolver; @@ -26,7 +25,7 @@ class UserSchemaExtension extends SchemaExtensionPluginBase { public function registerResolvers(ResolverRegistryInterface $registry): void { $builder = new ResolverBuilder(); - /** @var DecoratableTypeResolver $actor */ + /** @var \Drupal\social_graphql\GraphQL\DecoratableTypeResolver $actor */ $actor = $registry->getTypeResolver('Actor'); // Type resolvers. $registry->addTypeResolver('Actor', new UserActorTypeResolver($actor)); diff --git a/modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php b/modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php index ed78a96617e..d799eafc57d 100644 --- a/modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php +++ b/modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php @@ -2,6 +2,7 @@ namespace Drupal\social_user\Plugin\views\access; +use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Session\AccountInterface; use Symfony\Component\Routing\Route; use Drupal\views\Plugin\views\access\AccessPluginBase; @@ -22,7 +23,7 @@ class PeopleAccess extends AccessPluginBase { /** * {@inheritdoc} */ - public function summaryTitle(): \Drupal\Core\StringTranslation\TranslatableMarkup { + public function summaryTitle(): TranslatableMarkup { return $this->t('Unrestricted'); } diff --git a/modules/social_features/social_user_export/src/Plugin/Action/ExportUser.php b/modules/social_features/social_user_export/src/Plugin/Action/ExportUser.php index 50f717d23ba..7ad755f069e 100644 --- a/modules/social_features/social_user_export/src/Plugin/Action/ExportUser.php +++ b/modules/social_features/social_user_export/src/Plugin/Action/ExportUser.php @@ -2,6 +2,8 @@ namespace Drupal\social_user_export\Plugin\Action; +use Drupal\Core\Config\ImmutableConfig; +use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\File\FileSystem; use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Config\ConfigFactoryInterface; @@ -10,7 +12,6 @@ use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Session\AccountProxyInterface; use Drupal\file\FileRepository; -use Drupal\social_user_export\Plugin\UserExportPluginBase; use Drupal\views_bulk_operations\Action\ViewsBulkOperationsActionBase; use Drupal\Core\Session\AccountInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -46,35 +47,35 @@ class ExportUser extends ViewsBulkOperationsActionBase implements ContainerFacto * * @var \Drupal\social_user_export\Plugin\UserExportPluginManager */ - protected $userExportPlugin; + protected UserExportPluginManager $userExportPlugin; /** * User export plugin definitions. * * @var array */ - protected $pluginDefinitions; + protected array $pluginDefinitions; /** * A logger instance. * * @var \Psr\Log\LoggerInterface */ - protected $logger; + protected LoggerInterface $logger; /** * The current user account. * * @var \Drupal\Core\Session\AccountProxyInterface */ - protected $currentUser; + protected AccountProxyInterface $currentUser; /** * The user export plugin config object. * * @var \Drupal\Core\Config\ImmutableConfig */ - protected $config; + protected ImmutableConfig $config; /** * File URL Generator services. @@ -118,6 +119,8 @@ class ExportUser extends ViewsBulkOperationsActionBase implements ContainerFacto * The file url generator service. * @param \Drupal\file\FileRepository $file_repository * The file repository service. + * @param \Drupal\Core\File\FileSystem $file_system + * The file system service. */ public function __construct( array $configuration, @@ -171,7 +174,7 @@ public function executeMultiple(array $entities): array { if (empty($this->context['sandbox']['results']['headers'])) { $headers = []; foreach ($this->pluginDefinitions as $plugin) { - /** @var UserExportPluginBase $instance */ + /** @var \Drupal\social_user_export\Plugin\UserExportPluginBase $instance */ $instance = $this->userExportPlugin->createInstance($plugin['id']); $headers[] = $instance->getHeader(); } @@ -207,7 +210,7 @@ public function executeMultiple(array $entities): array { $row = []; foreach ($this->pluginDefinitions as $plugin) { $configuration = $this->getPluginConfiguration($plugin['id'], $entity_id); - /** @var UserExportPluginBase $instance */ + /** @var \Drupal\social_user_export\Plugin\UserExportPluginBase $instance */ $instance = $this->userExportPlugin->createInstance($plugin['id'], $configuration); $this->writeRow($row, $instance->getValue($entity)); } @@ -269,7 +272,7 @@ public function execute(Object $object = NULL): void { /** * {@inheritdoc} */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE): bool|\Drupal\Core\Access\AccessResultInterface { + public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE): bool|AccessResultInterface { /** @var \Drupal\user\UserInterface $object */ // @todo Check for export access instead. return $object->access('view', $account, $return_as_object); diff --git a/phpstan.neon b/phpstan.neon index 9692916e109..562f741e50e 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -71,9 +71,14 @@ parameters: - '#\\Drupal calls should be avoided in classes#' - '#Usage of deprecated trait Drupal\\social_profile\\SocialProfileTrait#' - '#Plugin definitions cannot be altered\.#' - - '#Access to an undefined property Drupal\\file\\FileInterface::\$\_referringItem\.#' + - '#Access to an undefined property Drupal\\file\\FileInterface::\$_referringItem\.#' - '#Access to an undefined property Drupal\\file\\FileInterface::\$download\.#' - ## Need to create services for that. + - '#Parameter \$item of static method Drupal\\social_eda\\Types\\Address::fromFieldItem\(\) expects Drupal\\address\\Plugin\\Field\\FieldType\\AddressItem\|null, Drupal\\Core\\Field\\FieldItemInterface\|null given.#' + ## Extend things from OS product. +# - '#Class Drupal\\social_eda_dispatcher\\Dispatcher not found.#' + - '#.*CloudEvents\\V1\\CloudEvent.*#' + - '#.*CloudEvents\\CloudEventInterface.*#' + ## Need to create services for that.a - '#Not allowed to call private function _activity_basics_entity_action from module social_follow_tag#' - '#Not allowed to call private function _activity_send_email_default_template_items from module social_swiftmail#' - '#Not allowed to call private function _addresses_to_string from module social_swiftmail#' @@ -88,7 +93,7 @@ parameters: - '#Not allowed to call private function _social_event_format_date from module social_activity#' - '#Not allowed to call private function _social_event_menu_local_tasks_routes from module social_event_managers#' - '#Not allowed to call private function _social_group_cache_tags from module social_group_flexible_group#' - - '#Not allowed to call private function _social_group_get_current_group from module social_(profile_manager_notes|post|profile_manager_notes|group_request|group_invite|group_gvbo|group_flexible_group|topic|flexible_group_book|follow_tag|social_book|social_metatag)#' + - '#Not allowed to call private function _social_group_get_current_group from module social_(profile_manager_notes|post|profile_manager_notes|group_request|group_invite|group_gvbo|group_flexible_group|topic|flexible_group_book|follow_tag|book|metatag|event)#' - '#Not allowed to call private function _social_group_get_group_invite_value from module social_group_invite#' - '#Not allowed to call private function _social_profile_get_profile_from_route from module social_profile_fields#' - '#Not allowed to call private function _social_profile_get_profile_from_route from module social_profile_manager_notes#' @@ -99,8 +104,11 @@ parameters: - '#Method Drupal\\.*\\Form\\.*::buildForm\(\) has parameter \$view_id with no type specified\.#' - '#Method Drupal\\.*\\Form\\.*::submitForm\(\) has no return type specified\.#' - '#Method Drupal\\.*\\Plugin\\views\\field\\.*::viewsFormValidate\(\) has parameter \$form with no type specified\.#' - - '#Method Drupal\\social_post\\Plugin\\views\\area\\SocialPostPostForm::buildOptionsForm\(\) has parameter \$form with no type specified\.#' + - '#Method Drupal\\.*\\Plugin\\views\\.*\\.*::buildOptionsForm\(\) has parameter \$form with no type specified\.#' + - '#Parameter \$group_membership_loader of method Drupal\\social_group_invite\\Form\\SocialBulkGroupInvitation::__construct\(\) has typehint with deprecated interface Drupal\\group\\GroupMembershipLoaderInterface.#' ## To review after Drupal 11 + - '#Access to an undefined property Drupal\\views\\ViewExecutable::\$filter_type.#' + - '#Access to an undefined property Drupal\\node\\NodeInterface::\$original\.#' - '#Method Drupal\\Core\\Form\\FormBuilderInterface::getForm\(\) invoked with 2 parameters, 1 required#' - '#Method Drupal\\social_group\\Plugin\\views\\argument\\UserUid::query\(\) has parameter \$group_by with no type specified\.#' - '#Method Drupal\\activity_viewer\\Plugin\\views\\argument\\ActivityProfileArgument::query\(\) has parameter \$group_by with no type specified\.#' @@ -108,7 +116,6 @@ parameters: - '#Method Drupal\\.*\\Plugin\\Action\\.*::execute\(\) has parameter \$entity with no type specified\.#' - '#Method Drupal\\activity_viewer\\Plugin\\views\\row\\ActivityRow::preRender\(\) has parameter \$result with no type specified\.#' - '#Method Drupal\\social_post_album\\Element\\SocialPostAlbumManagedFile::processManagedFile\(\) has (?:no return type specified\.|parameter \$complete_form with no type specified\.|parameter \$element with no type specified\.)#' - ## Extend of @internal API - '#Class .* extends @internal class .*\.#' diff --git a/tests/behat/features/bootstrap/GroupContext.php b/tests/behat/features/bootstrap/GroupContext.php index 00dab35361d..83d6de923dc 100644 --- a/tests/behat/features/bootstrap/GroupContext.php +++ b/tests/behat/features/bootstrap/GroupContext.php @@ -514,12 +514,12 @@ public function viewingGroup(string $group) : void { public function shouldBeViewingGroup(string $group) : void { $group_id = $this->getNewestGroupIdFromTitle($group); if ($group_id === NULL) { - throw new \RuntimeException("Group '${group}' does not exist."); + throw new \RuntimeException("Group '{$group}' does not exist."); } $this->assertSession()->statusCodeEquals(200); // We may need to change the path here since the default group page is // configurable. - $this->assertSession()->addressEquals("/group/${group_id}/about"); + $this->assertSession()->addressEquals("/group/{$group_id}/about"); } /** @@ -562,7 +562,7 @@ public function groupIsPreselected(string $group) : void { $group_id = $this->getNewestGroupIdFromTitle($group); if ($group_id === NULL) { - throw new \RuntimeException("Group '${group}' does not exist."); + throw new \RuntimeException("Group '{$group}' does not exist."); } $selected = $field->getValue(); diff --git a/tests/behat/features/bootstrap/SocialDrupalContext.php b/tests/behat/features/bootstrap/SocialDrupalContext.php index 060da2f7685..648d084de16 100644 --- a/tests/behat/features/bootstrap/SocialDrupalContext.php +++ b/tests/behat/features/bootstrap/SocialDrupalContext.php @@ -23,10 +23,10 @@ class SocialDrupalContext extends DrupalContext { * Add support for Bigpipe in Behat tests. * * @param \Behat\Behat\Hook\Scope\BeforeScenarioScope $scope - * The scenario scope. + * The scenario scope. * - * Original PR here: - * https://github.com/jhedstrom/drupalextension/pull/325 + * Original PR here: + * https://github.com/jhedstrom/drupalextension/pull/325. * * @BeforeScenario @api */ @@ -60,7 +60,7 @@ public function prepareBigPipeNoJsCookie(BeforeScenarioScope $scope): void { * Call this function before users are created. * * @param \Drupal\DrupalExtension\Hook\Scope\EntityScope $scope - * The entity scope. + * The entity scope. * * @beforeUserCreate */ diff --git a/tests/behat/features/bootstrap/TopicContext.php b/tests/behat/features/bootstrap/TopicContext.php index 68f19776586..01393192999 100644 --- a/tests/behat/features/bootstrap/TopicContext.php +++ b/tests/behat/features/bootstrap/TopicContext.php @@ -236,9 +236,9 @@ public function iViewTheTopicCreationPage() : void { public function iEditTopicUsingTheForm(string $title, TableNode $fields) : void { $topic_id = $this->getTopicIdFromTitle($title); if ($topic_id === NULL) { - throw new \RuntimeException("Topic with title '${title}' does not exist. Did you create it in the test?"); + throw new \RuntimeException("Topic with title '{$title}' does not exist. Did you create it in the test?"); } - $this->visitPath("/node/${topic_id}/edit"); + $this->visitPath("/node/{$topic_id}/edit"); $this->minkContext->saveScreenshot("edit-topic.png", "/var/www/html/profiles/contrib/social/tests/behat/logs"); @@ -302,15 +302,15 @@ protected function fillOutTopicForm(TableNode $fields) : array { do { $element = $element->getParent(); if ($element->getTagName() === "body") { - throw new \RuntimeException("${field} was not visible but could not find a parent 'details' element to expand."); + throw new \RuntimeException("{$field} was not visible but could not find a parent 'details' element to expand."); } } while ($element->getTagName() !== "details"); if ($element->hasAttribute("open")) { - throw new \RuntimeException("${field} was in an open details element but was still not visible."); + throw new \RuntimeException("{$field} was in an open details element but was still not visible."); } $summary = $element->find('named', 'summary'); if ($summary === NULL) { - throw new \RuntimeException("${field} was in a closed details element but the details element did not contain a summary to expand it."); + throw new \RuntimeException("{$field} was in a closed details element but the details element did not contain a summary to expand it."); } // This should expand the details so that we can check the field. $summary->click(); diff --git a/tests/phpstan/data/install_example/install_example.install b/tests/phpstan/data/install_example/install_example.install index 4f355a8630a..b46f5ecfaca 100644 --- a/tests/phpstan/data/install_example/install_example.install +++ b/tests/phpstan/data/install_example/install_example.install @@ -1,7 +1,8 @@