-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Question : PSR-11 and get / has #21220
Comments
This repo is for bug tracking. This isn't a bug so you can open a proposal in the laravel/internals repo |
Seems like according to
it is pretty explicit that it "finds an entry" of the container by its "identifier". So just allowing Laravel's container to return a concrete, doesn't really fit. However I can see why this may be convenient. |
@devcircus did you checked how the dms container is working ? |
Please ask on the forums, this repo is for bug reporting only. You can use https://laracasts.com/discuss or https://laravel.io/forum which are forums with a very large community of developers helping each other. |
The Laravel's PSR-11 implementation is buggy. Because |
I agree with you. If PSR-11 was added to let laravel devs replace that container with PSR-11 interface, then the entire logic which works in laravel's container should work the same under PSR-11 interface. |
@golaod Laravel's container already makes use of PSR-11. |
Description:
According to PSR-11 https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md#31-psrcontainercontainerinterface
Now if you have not registered anything the container always throws
Illuminate\Container\EntryNotFoundException
.But Illuminate Container can create instances via make method. This is my take, if there is a concrete class, container should be able to create the object. Else throw the exception. The
has
method need to be modified for the same.I am looking at an implementation
https://github.com/dms-org/web.laravel/blob/582d970393656a011ffcee4f6716ae79c5e57813/src/Ioc/LaravelIocContainer.php#L157 of psr-11 before 5.5 .
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: