PERF: avoid reinstantiation of event subscribers

This commit is contained in:
Toby Zerner 2015-07-27 11:53:55 +09:30
parent c4b32f1326
commit 608d4a1a47
2 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ class AddBBCodeFormatter
{ {
public function subscribe(Dispatcher $events) public function subscribe(Dispatcher $events)
{ {
$events->listen(FormatterConfigurator::class, __CLASS__.'@addBBCodeFormatter'); $events->listen(FormatterConfigurator::class, [$this, 'addBBCodeFormatter']);
} }
public function addBBCodeFormatter(FormatterConfigurator $event) public function addBBCodeFormatter(FormatterConfigurator $event)

View File

@ -8,8 +8,8 @@ class AddClientAssets
{ {
public function subscribe(Dispatcher $events) public function subscribe(Dispatcher $events)
{ {
$events->listen(RegisterLocales::class, __CLASS__.'@addLocale'); $events->listen(RegisterLocales::class, [$this, 'addLocale']);
$events->listen(BuildClientView::class, __CLASS__.'@addAssets'); $events->listen(BuildClientView::class, [$this, 'addAssets']);
} }
public function addLocale(RegisterLocales $event) public function addLocale(RegisterLocales $event)