From 6a9b69354000b116829453caabb523c552436797 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 fc13a78f3d3fa..414345c356d89 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -46,6 +46,7 @@ use OCP\Search\IProvider; use OCP\Support\CrashReport\IReporter; use Throwable; +use function array_shift; class RegistrationContext { @@ -370,7 +371,7 @@ public function delegateContainerRegistrations(array $apps): void { } } - foreach ($this->aliases as $registration) { + while (($registration = array_shift($this->aliases)) !== null) { try { $apps[$registration->getAppId()] ->getContainer() @@ -387,7 +388,7 @@ public function delegateContainerRegistrations(array $apps): void { } } - foreach ($this->parameters as $registration) { + while (($registration = array_shift($this->parameters)) !== null) { try { $apps[$registration->getAppId()] ->getContainer()