From 4bf1d005f71b3b9db88f520f106155582122538c Mon Sep 17 00:00:00 2001 From: Giuseppe Mazzapica Date: Fri, 24 May 2024 12:20:06 +0200 Subject: [PATCH] Fix status check in PackageProxyContainer When status is STATUS_INITIALIZED or above, it is possible to access the package container. Right now, PackageProxyContainer only access the container after booting which is wrong and make usage of build() "dangerous". --- src/Container/PackageProxyContainer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Container/PackageProxyContainer.php b/src/Container/PackageProxyContainer.php index d5e3954..207985f 100644 --- a/src/Container/PackageProxyContainer.php +++ b/src/Container/PackageProxyContainer.php @@ -66,7 +66,9 @@ private function tryContainer(): bool /** TODO: We need a better way to deal with status checking besides equality */ if ( - $this->package->statusIs(Package::STATUS_READY) + $this->package->statusIs(Package::STATUS_INITIALIZED) + || $this->package->statusIs(Package::STATUS_MODULES_ADDED) + || $this->package->statusIs(Package::STATUS_READY) || $this->package->statusIs(Package::STATUS_BOOTED) ) { $this->container = $this->package->container();