laminas / laminas-diactoros

PSR HTTP Message implementations
https://docs.laminas.dev/laminas-diactoros/
BSD 3-Clause "New" or "Revised" License
483 stars 63 forks source link

Add `UriFactory::createFromSapi()` #123

Closed markstory closed 1 year ago

markstory commented 1 year ago
Q A
Documentation yes
Bugfix no
BC Break no
New Feature yes
RFC yes
QA no

Description

This method will provide a public API to create Uri instances from SERVER context. This helps libraries that depend on diactoros and have their own ServerRequest or Uri implementations use the logic in diactoros more efficiently.

I wanted to get a rough draft of this up for feedback. If it is headed in the right direction, I have a few TODOs remaining:

If there are other requirements that need to be met let me know :smile:

Refs #122

Ocramius commented 1 year ago

/cc @froschdesign for getting guidance on the docs section

Ocramius commented 1 year ago

BTW, overall direction of this patch is good :+1:

markstory commented 1 year ago

I've resolved all but one of psalm's complaints. The remaining MixedArgumentTypeCoercion was added to the baseline file beside the existing one in the same method.

Ocramius commented 1 year ago

Went through it again: I know most code is just transposed as-is, so we're good here.

Releasing 🚢