-
Notifications
You must be signed in to change notification settings - Fork 18
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
laminas/laminas-diactoros is under require-dev #40
Comments
Hi Mark, The latest release this package no longer requires Where that error comes from? If you can give me the location (i.e., file and line) of that error, I can probably try to reproduce. Thank you. |
Closing this issue due to inactivity. |
Hi @meng-tian!
What should be passed as a second and third parameter to the PS. When I ran |
The example in README does use Again, I want to reiterate that |
Previously we used "^0.2.5" and there was no need for these two new parameters. IMHO the example in README should just work upon installation. If there is a need for implementation of Stream/Factory it should be mentioned and explained in short what it does and why it's needed. (Or maybe these two new parameters could be passed even as nulls?) |
No, the second and third parameters must be not null.
Well, it kind of self-explanatory. Both those two parameters require an instance of the interface. This naturally implies that an implementation of the interface is needed. You cannot instantiate an interface in PHP, so you have to instantiate a implementation of the interface instead. Not having a hard dependency on a specific implementation (e.g., laminas-diactoros ) makes this library flexible to meet when users are. Different users could choose their own preferred implementations, rather than being forced to use one specific implementation. |
I have to agree that the usage of the lib is rather confusing now. It has required parameters for its actual setup, but no implementation details of what those two parameters are in practical terms. The Readme compounds confusion as it's showing a constructor based on a library that is not packaged with this library without any notes or info. I appreciate the option of flexibility, but almost all libraries that require a certain type of dependency to be passed into its own constructor include the dependency lib in it's composer.json, or provide instructions on where/what those objects are. We too are doing a migration from 0.2.x to 0.4.x and it's still not obvious to me what the two new parameters are in code. I'm assuming we need to create two new classes that implement |
I'll try address the confusion by updating the README to give clearer explanation on how v4.0+ should be installed and used. I'll try my best to finish #43 within this week. |
#43 is now resolved. Let me know if the usage and installation is clearer than before. |
Thanks @meng-tian! |
Trying to utilize this package but I get the error:
Class 'Laminas\Diactoros\StreamFactory' not found
I looked at the composer.json file and you have
laminas/laminas-diactoros
underrequire-dev
. Shouldn't it be included under therequire
key if it's a package dependency?The text was updated successfully, but these errors were encountered: