Rename methods

This commit is contained in:
Oliver Davies 2021-01-13 17:56:57 +00:00
parent 7e06943be1
commit 5e9dc48896
2 changed files with 5 additions and 5 deletions

View file

@ -23,12 +23,12 @@ final class PushPostToSocialMediaOnceItIsPublished implements EventSubscriberInt
*/ */
public static function getSubscribedEvents() { public static function getSubscribedEvents() {
return [ return [
HookEventDispatcherInterface::ENTITY_INSERT => 'onEntityUpdate', HookEventDispatcherInterface::ENTITY_INSERT => 'pushPost',
HookEventDispatcherInterface::ENTITY_UPDATE => 'onEntityUpdate', HookEventDispatcherInterface::ENTITY_UPDATE => 'pushPost',
]; ];
} }
public function onEntityUpdate(AbstractEntityEvent $event): void { public function pushPost(AbstractEntityEvent $event): void {
$entity = $event->getEntity(); $entity = $event->getEntity();
if ($entity->getEntityTypeId() != 'node') { if ($entity->getEntityTypeId() != 'node') {

View file

@ -17,11 +17,11 @@ final class SortTagsAlphabeticallyWhenPostIsSaved implements EventSubscriberInte
*/ */
public static function getSubscribedEvents() { public static function getSubscribedEvents() {
return [ 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(); $entity = $event->getEntity();
if ($entity->getEntityTypeId() != 'node') { if ($entity->getEntityTypeId() != 'node') {