Closed gmazzap closed 1 week ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.42%. Comparing base (
bd65297
) to head (5c6b990
). Report is 6 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Bug fix.
What is the current behavior? (You can also link to an open issue here)
A connected package's services can not be accessed if the package is "built"
What is the new behavior (if this is a feature change)?
A connected package's services can be accessed if the package is "built".
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No.
Other information:
The implementation of
Package::connect()
predates the implementation ofPackage::built()
.Before
Package::built()
was introduced in 1.7.0 it was only safe to access a Package's container after having calledPackage::boot()
.Now, we can do
$package->build()->container()
without issues.The implementation of
PackageProxyContainer
was not updated when we introducedPackage::built()
, so we can still not access services from connected packages if they are not booted.This means using
built()
early andboot()
later, which is the reason why we introducedbuilt()
in the first place is "dangerous" because if someone connects a built package and tries to access its services they will get an exception.I committed a test to
master
that tests there the bug, and this test is merged back into this branch to prove this is now solved.