From 2eb21bdceb724229a1c2ff1551c56d1d067e0f28 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 24 Feb 2021 17:30:10 +0100 Subject: [PATCH] Register service aliases und parameters just once Signed-off-by: Christoph Wurst --- lib/private/AppFramework/Bootstrap/RegistrationContext.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php index d2dc365d83..988313f20e 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -38,6 +38,7 @@ use OCP\Dashboard\IManager; use OCP\EventDispatcher\IEventDispatcher; use OCP\ILogger; use Throwable; +use function array_shift; class RegistrationContext { @@ -399,7 +400,7 @@ class RegistrationContext { } } - foreach ($this->aliases as $registration) { + while (($registration = array_shift($this->aliases)) !== null) { try { $apps[$registration['appId']] ->getContainer() @@ -416,7 +417,7 @@ class RegistrationContext { } } - foreach ($this->parameters as $registration) { + while (($registration = array_shift($this->parameters)) !== null) { try { $apps[$registration['appId']] ->getContainer()