Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.7] PSR-11 container #4579

Merged
merged 2 commits into from
Oct 4, 2018
Merged

[5.7] PSR-11 container #4579

merged 2 commits into from
Oct 4, 2018

Conversation

deleugpn
Copy link
Contributor

@deleugpn deleugpn commented Oct 3, 2018

Docs for laravel/framework#25870 in case we choose this path.

@driesvints driesvints changed the title PSR-11 container [5.7] PSR-11 container Oct 4, 2018
@@ -276,4 +276,4 @@ Laravel's service container implements the [PSR-11](https://github.com/php-fig/f
//
});

> {note} Calling the `get` method will throw an exception if the identifier has not been explicitly bound into the container.
If the identifier cannot be resolved an exception is thrown. The exception will be `Psr\Container\NotFoundExceptionInterface` if the identifier was never bound or a `Psr\Container\ContainerExceptionInterface` otherwise.
Copy link
Contributor

@svenluijten svenluijten Oct 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this needs some rewording. What do you think of this?

If the identifier cannot be resolved, a Psr\Container\NotFoundExceptionInterface is thrown. Otherwise, if the identifier was never bound, a Psr\Container\ContainerExceptionInterface is thrown instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you say Otherwise after If the identifier cannot be resolved, I imagine it's talking about if the identifier can be resolved, which is actually false. Furthermore, stating that a Psr\Container\NotfoundExceptionInterface is thrown if the identifier cannot be resolved is false because it depends on whether the identifier was bound or not. The second part of the statement is also wrong as Psr\Container\ContainerExceptionInterface is thrown if the identifier was bound and not resolved.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I completely misread the original text! Ignore me 😄

@taylorotwell taylorotwell merged commit 6a45334 into laravel:5.7 Oct 4, 2018
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