Skip to content

Commit

Permalink
Also rename other generic manager to the correct variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
melroy89 committed Dec 17, 2024
1 parent c9d3aaf commit 9b02e5c
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions src/MessageHandler/ActivityPub/Inbox/AnnounceHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
private readonly ActivityPubManager $activityPubManager,
private readonly EntityManagerInterface $entityManager,
private readonly MessageBusInterface $bus,
private readonly VoteManager $manager,
private readonly VoteManager $voteManager,
private readonly VoteHandleSubscriber $voteHandleSubscriber,
private readonly LoggerInterface $logger,
) {
Expand Down Expand Up @@ -57,7 +57,7 @@ public function doWork(MessageInterface $message): void
$actor = $this->activityPubManager->findActorOrCreate($message->payload['actor']);

if ($actor instanceof User) {
$this->manager->upvote($entity, $actor);
$this->voteManager->upvote($entity, $actor);
$this->voteHandleSubscriber->clearCache($entity);
} else {
$entity->lastActive = new \DateTime();
Expand Down
6 changes: 3 additions & 3 deletions src/MessageHandler/ActivityPub/Inbox/LikeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(
private readonly ActivityPubManager $activityPubManager,
private readonly VoteManager $voteManager,
private readonly MessageBusInterface $bus,
private readonly FavouriteManager $manager,
private readonly FavouriteManager $favouriteManager,
private readonly LoggerInterface $logger,
) {
parent::__construct($this->entityManager);
Expand Down Expand Up @@ -66,7 +66,7 @@ public function doWork(MessageInterface $message): void
$actor = $this->activityPubManager->findActorOrCreate($message->payload['actor']);
// Check if actor and entity aren't empty
if (!empty($actor) && !empty($entity)) {
$this->manager->toggle($actor, $entity, FavouriteManager::TYPE_LIKE);
$$this->favouriteManager->toggle($actor, $entity, FavouriteManager::TYPE_LIKE);
}
} elseif ('Undo' === $message->payload['type']) {
if ('Like' === $message->payload['object']['type']) {
Expand All @@ -78,7 +78,7 @@ public function doWork(MessageInterface $message): void
$actor = $this->activityPubManager->findActorOrCreate($message->payload['actor']);
// Check if actor and entity aren't empty
if (!empty($actor) && !empty($entity)) {
$this->manager->toggle($actor, $entity, FavouriteManager::TYPE_UNLIKE);
$$this->favouriteManager->toggle($actor, $entity, FavouriteManager::TYPE_UNLIKE);
$this->voteManager->removeVote($entity, $actor);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentEntryCommentCreatedNotificationHandler extends MbinMessageHandler
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly EntryCommentRepository $repository,
private readonly NotificationManager $manager
private readonly NotificationManager $notificationManager
) {
parent::__construct($this->entityManager);
}
Expand All @@ -40,6 +40,6 @@ public function doWork(MessageInterface $message): void
throw new UnrecoverableMessageHandlingException('Comment not found');
}

$this->manager->sendCreated($comment);
$this->notificationManager->sendCreated($comment);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentEntryCommentDeletedNotificationHandler extends MbinMessageHandler
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly EntryCommentRepository $repository,
private readonly NotificationManager $manager
private readonly NotificationManager $notificationManager
) {
parent::__construct($this->entityManager);
}
Expand All @@ -40,6 +40,6 @@ public function doWork(MessageInterface $message): void
throw new UnrecoverableMessageHandlingException('Comment not found');
}

$this->manager->sendDeleted($comment);
$this->notificationManager->sendDeleted($comment);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentEntryCommentEditedNotificationHandler extends MbinMessageHandler
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly EntryCommentRepository $repository,
private readonly NotificationManager $manager
private readonly NotificationManager $notificationManager
) {
parent::__construct($this->entityManager);
}
Expand All @@ -40,6 +40,6 @@ public function doWork(MessageInterface $message): void
throw new UnrecoverableMessageHandlingException('Comment not found');
}

$this->manager->sendEdited($comment);
$this->notificationManager->sendEdited($comment);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentEntryCreatedNotificationHandler extends MbinMessageHandler
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly EntryRepository $repository,
private readonly NotificationManager $manager
private readonly NotificationManager $notificationManager
) {
parent::__construct($this->entityManager);
}
Expand All @@ -40,6 +40,6 @@ public function doWork(MessageInterface $message): void
throw new UnrecoverableMessageHandlingException('Entry not found');
}

$this->manager->sendCreated($entry);
$this->notificationManager->sendCreated($entry);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentEntryDeletedNotificationHandler extends MbinMessageHandler
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly EntryRepository $repository,
private readonly NotificationManager $manager
private readonly NotificationManager $notificationManager
) {
parent::__construct($this->entityManager);
}
Expand All @@ -40,6 +40,6 @@ public function doWork(MessageInterface $message): void
throw new UnrecoverableMessageHandlingException('Entry not found');
}

$this->manager->sendDeleted($entry);
$this->notificationManager->sendDeleted($entry);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentEntryEditedNotificationHandler extends MbinMessageHandler
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly EntryRepository $repository,
private readonly NotificationManager $manager
private readonly NotificationManager $notificationManager
) {
parent::__construct($this->entityManager);
}
Expand All @@ -40,6 +40,6 @@ public function doWork(MessageInterface $message): void
throw new UnrecoverableMessageHandlingException('Entry not found');
}

$this->manager->sendEdited($entry);
$this->notificationManager->sendEdited($entry);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentMagazineBanNotificationHandler extends MbinMessageHandler
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly MagazineBanRepository $repository,
private readonly NotificationManager $manager
private readonly NotificationManager $notificationManager
) {
parent::__construct($this->entityManager);
}
Expand All @@ -40,6 +40,6 @@ public function doWork(MessageInterface $message): void
throw new UnrecoverableMessageHandlingException('Ban not found');
}

$this->manager->sendMagazineBanNotification($ban);
$this->notificationManager->sendMagazineBanNotification($ban);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentPostCommentCreatedNotificationHandler extends MbinMessageHandler
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly PostCommentRepository $repository,
private readonly NotificationManager $manager
private readonly NotificationManager $notificationManager
) {
parent::__construct($this->entityManager);
}
Expand All @@ -40,6 +40,6 @@ public function doWork(MessageInterface $message): void
throw new UnrecoverableMessageHandlingException('Comment not found');
}

$this->manager->sendCreated($comment);
$this->notificationManager->sendCreated($comment);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentPostCommentDeletedNotificationHandler extends MbinMessageHandler
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly PostCommentRepository $repository,
private readonly NotificationManager $manager
private readonly NotificationManager $notificationManager
) {
parent::__construct($this->entityManager);
}
Expand All @@ -40,6 +40,6 @@ public function doWork(MessageInterface $message): void
throw new UnrecoverableMessageHandlingException('Comment not found');
}

$this->manager->sendDeleted($comment);
$this->notificationManager->sendDeleted($comment);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentPostCommentEditedNotificationHandler extends MbinMessageHandler
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly PostCommentRepository $repository,
private readonly NotificationManager $manager
private readonly NotificationManager $notificationManager
) {
parent::__construct($this->entityManager);
}
Expand All @@ -40,6 +40,6 @@ public function doWork(MessageInterface $message): void
throw new UnrecoverableMessageHandlingException('Comment not found');
}

$this->manager->sendEdited($comment);
$this->notificationManager->sendEdited($comment);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentPostCreatedNotificationHandler extends MbinMessageHandler
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly PostRepository $repository,
private readonly NotificationManager $manager
private readonly NotificationManager $notificationManager
) {
parent::__construct($this->entityManager);
}
Expand All @@ -40,6 +40,6 @@ public function doWork(MessageInterface $message): void
throw new UnrecoverableMessageHandlingException('Post not found');
}

$this->manager->sendCreated($post);
$this->notificationManager->sendCreated($post);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentPostDeletedNotificationHandler extends MbinMessageHandler
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly PostRepository $repository,
private readonly NotificationManager $manager
private readonly NotificationManager $notificationManager
) {
parent::__construct($this->entityManager);
}
Expand All @@ -40,6 +40,6 @@ public function doWork(MessageInterface $message): void
throw new UnrecoverableMessageHandlingException('Post not found');
}

$this->manager->sendDeleted($post);
$this->notificationManager->sendDeleted($post);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SentPostEditedNotificationHandler extends MbinMessageHandler
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly PostRepository $repository,
private readonly NotificationManager $manager
private readonly NotificationManager $notificationManager
) {
parent::__construct($this->entityManager);
}
Expand All @@ -40,6 +40,6 @@ public function doWork(MessageInterface $message): void
throw new UnrecoverableMessageHandlingException('Post not found');
}

$this->manager->sendEdited($post);
$this->notificationManager->sendEdited($post);
}
}
4 changes: 2 additions & 2 deletions src/Service/ActivityPub/Wrapper/MentionsWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class MentionsWrapper
{
public function __construct(
private readonly ActivityPubManager $manager,
private readonly ActivityPubManager $activityPubManager,
private readonly UrlGeneratorInterface $urlGenerator,
private readonly MentionManager $mentionManager,
private readonly SettingsManager $settingsManager
Expand All @@ -26,7 +26,7 @@ public function build(?array $mentions, ?string $body = null): array
$results = [];
foreach ($mentions as $index => $mention) {
try {
$actor = $this->manager->findActorOrCreate($mention);
$actor = $this->activityPubManager->findActorOrCreate($mention);

if (!$actor) {
continue;
Expand Down

0 comments on commit 9b02e5c

Please sign in to comment.