From c5bb8bcf6c9d6e2c46758133076f413c550380b9 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 27 Jul 2015 11:54:03 +0930 Subject: [PATCH] PERF: avoid reinstantiation of event subscribers --- extensions/emoji/src/Listeners/AddClientAssets.php | 4 ++-- extensions/emoji/src/Listeners/AddEmoticons.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/emoji/src/Listeners/AddClientAssets.php b/extensions/emoji/src/Listeners/AddClientAssets.php index ab74fcc5b..da8cb54b7 100644 --- a/extensions/emoji/src/Listeners/AddClientAssets.php +++ b/extensions/emoji/src/Listeners/AddClientAssets.php @@ -8,8 +8,8 @@ class AddClientAssets { public function subscribe(Dispatcher $events) { - $events->listen(RegisterLocales::class, __CLASS__.'@addLocale'); - $events->listen(BuildClientView::class, __CLASS__.'@addAssets'); + $events->listen(RegisterLocales::class, [$this, 'addLocale']); + $events->listen(BuildClientView::class, [$this, 'addAssets']); } public function addLocale(RegisterLocales $event) diff --git a/extensions/emoji/src/Listeners/AddEmoticons.php b/extensions/emoji/src/Listeners/AddEmoticons.php index 756c2a6b2..e8303cadb 100644 --- a/extensions/emoji/src/Listeners/AddEmoticons.php +++ b/extensions/emoji/src/Listeners/AddEmoticons.php @@ -7,7 +7,7 @@ class AddEmoticons { public function subscribe(Dispatcher $events) { - $events->listen(FormatterConfigurator::class, __CLASS__.'@addEmoticons'); + $events->listen(FormatterConfigurator::class, [$this, 'addEmoticons']); } public function addEmoticons(FormatterConfigurator $event)