Closed Taluu closed 7 years ago
The best solution IMO would indeed be to move the "optional dependencies" into separate packages. But as that would be a BC break adding php-http/message-factory-implementation
to the provide
section looks like a reasonable solution to me.
Sorry for the delay, The php-http/message-factory-implementation is not a virtual package we have created.
Where do you need this? I code to the interface and let auto discovery fail if no factories are found.
Maybe then moving the "optionnal dependencies" to their own client / repos and leaving these here with a replace
could do the trick too, in order to keep bc ?
@Nyholm I am needing it in https://github.com/Taluu/Behapi/pull/12
So then should I remove the virtual dependency ? I thought requiring this virtual package could be useful in order to let people know that I need a factory
went on a hunt for this and found https://github.com/php-http/message-factory/blob/v0.2.0/README.md#usage - newer versions don't talk about this anymore. packagist has one package registered with the provide it seems: https://packagist.org/providers/php-http/message-factory-implementation
it looks like we decided to not model this with a virtual package.
Actual Behavior
This package doesn't say it provides message factories (implementing
php-http/message-factory-implementation
). So if a package requires this implementation, it will not be installable, even though there are messages factories in this repository.Expected Behavior
Stating that this package implements
php-http/message-factory-implementation
Possible Solutions
Stating that this package implements
php-http/message-factory-implementation
Even though it is also not technically correct as if one of these 3 factories can't be accessed (because their main vendor is not installed). Another solution would be to decouple these implementations into their own repositories (and stating then that it can implement said interface), or putting these in their client package (e.g for guzzle, putting its classes into the guzzle5 and guzzle6 adapters)