Skip to content

Commit

Permalink
Fix status check in PackageProxyContainer
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
gmazzap committed May 24, 2024
1 parent c6855a6 commit 4bf1d00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Container/PackageProxyContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 4bf1d00

Please sign in to comment.