From 5e9dc48896130c63fb45b432ccfffb56b8a56df6 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 13 Jan 2021 17:56:57 +0000 Subject: [PATCH] Rename methods --- .../PushPostToSocialMediaOnceItIsPublished.php | 6 +++--- .../SortTagsAlphabeticallyWhenPostIsSaved.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/modules/custom/blog/src/EventSubscriber/PushPostToSocialMediaOnceItIsPublished.php b/web/modules/custom/blog/src/EventSubscriber/PushPostToSocialMediaOnceItIsPublished.php index ee6d137..5a37f49 100644 --- a/web/modules/custom/blog/src/EventSubscriber/PushPostToSocialMediaOnceItIsPublished.php +++ b/web/modules/custom/blog/src/EventSubscriber/PushPostToSocialMediaOnceItIsPublished.php @@ -23,12 +23,12 @@ final class PushPostToSocialMediaOnceItIsPublished implements EventSubscriberInt */ public static function getSubscribedEvents() { return [ - HookEventDispatcherInterface::ENTITY_INSERT => 'onEntityUpdate', - HookEventDispatcherInterface::ENTITY_UPDATE => 'onEntityUpdate', + HookEventDispatcherInterface::ENTITY_INSERT => 'pushPost', + HookEventDispatcherInterface::ENTITY_UPDATE => 'pushPost', ]; } - public function onEntityUpdate(AbstractEntityEvent $event): void { + public function pushPost(AbstractEntityEvent $event): void { $entity = $event->getEntity(); if ($entity->getEntityTypeId() != 'node') { diff --git a/web/modules/custom/blog/src/EventSubscriber/SortTagsAlphabeticallyWhenPostIsSaved.php b/web/modules/custom/blog/src/EventSubscriber/SortTagsAlphabeticallyWhenPostIsSaved.php index 0978e12..b032744 100644 --- a/web/modules/custom/blog/src/EventSubscriber/SortTagsAlphabeticallyWhenPostIsSaved.php +++ b/web/modules/custom/blog/src/EventSubscriber/SortTagsAlphabeticallyWhenPostIsSaved.php @@ -17,11 +17,11 @@ final class SortTagsAlphabeticallyWhenPostIsSaved implements EventSubscriberInte */ public static function getSubscribedEvents() { return [ - HookEventDispatcherInterface::ENTITY_PRE_SAVE => 'onEntityPreSave', + HookEventDispatcherInterface::ENTITY_PRE_SAVE => 'sortTags', ]; } - public function onEntityPresave(AbstractEntityEvent $event): void { + public function sortTags(AbstractEntityEvent $event): void { $entity = $event->getEntity(); if ($entity->getEntityTypeId() != 'node') {