summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2023-01-20 13:26:43 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2023-01-20 13:26:43 +0100
commita911320bab8039498decc8e3783e333ac965e4cd (patch)
treec3a3f74912f055881fe0d14321fdef53ddfe765a /lib
parentc0f1bf940595b02ccc9120495667dcc1898e55eb (diff)
perf(PHP): Use static closures for registrations
Micro performance optimization as it allows PHP to GC the surrounding class earlier when `$this` isn't bound to the closure. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/AppInfo/Application.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php
index cf9803e6f..b54946725 100644
--- a/lib/AppInfo/Application.php
+++ b/lib/AppInfo/Application.php
@@ -198,7 +198,7 @@ class Application extends App implements IBootstrap {
/** @var IProviderManager $resourceManager */
$resourceManager = $server->get(IProviderManager::class);
$resourceManager->registerResourceProvider(ConversationProvider::class);
- $server->getEventDispatcher()->addListener(LoadAdditionalScriptsEvent::class, function () {
+ $server->getEventDispatcher()->addListener(LoadAdditionalScriptsEvent::class, static function () {
Util::addScript(self::APP_ID, 'talk-collections');
});
}
@@ -212,7 +212,7 @@ class Application extends App implements IBootstrap {
}
protected function registerNavigationLink(IServerContainer $server): void {
- $server->getNavigationManager()->add(function () use ($server) {
+ $server->getNavigationManager()->add(static function () use ($server) {
/** @var Config $config */
$config = $server->get(Config::class);
$user = $server->getUserSession()->getUser();