php-http / message

HTTP Message related tools
http://php-http.org
MIT License
1.29k stars 41 forks source link

Missing provides in composer.json file #75

Closed Taluu closed 7 years ago

Taluu commented 7 years ago
Q A
Bug? yes and no
New Feature? yes and no
Version Latest

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)

xabbuh commented 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.

Nyholm commented 7 years ago

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.

Taluu commented 7 years ago

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

dbu commented 7 years ago

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.