laminas / laminas-diactoros

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

Add `UriFactory::createFromSapi()` #123

Closed markstory closed 2 years ago

markstory commented 2 years 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 2 years ago

/cc @froschdesign for getting guidance on the docs section

Ocramius commented 2 years ago

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

markstory commented 2 years 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 2 years ago

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

Releasing 🚢