Skip to content

Conversation

franzliedke
Copy link
Contributor

This had the potential to cause complications in combination with other packages.

Resolving objects from the container should always be done in boot() or in some type of callback (such as the resolving() method), so that other packages have the chance to either use Container::extend() or Container::resolving() on these objects.

@franzliedke
Copy link
Contributor Author

Oh, I just noticed that you will definitely resolve the database object in your boot() method. That could be optimized by either moving the previous code from register() to boot() or by moving the static calls in boot() to the callback that is passed to resolving(). Hope that makes sense.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling f39c67a on franzliedke:patch-1 into 27b5206 on jenssegers:master.

jenssegers added a commit that referenced this pull request Aug 3, 2014
Only extend database when it is actually resolved.
@jenssegers jenssegers merged commit 96be808 into mongodb:master Aug 3, 2014
@jenssegers
Copy link
Contributor

Thanks! I moved it to the boot method.

mnphpexpert added a commit to mnphpexpert/laravel-mongodb that referenced this pull request Sep 2, 2024
Only extend database when it is actually resolved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants