Skip to content

Ensure that Nyholm PSR17 factory is fully available#3426

Merged
odan merged 3 commits into
slimphp:4.xfrom
andrewnicols:nyholmServerWithoutClient
Jun 6, 2026
Merged

Ensure that Nyholm PSR17 factory is fully available#3426
odan merged 3 commits into
slimphp:4.xfrom
andrewnicols:nyholmServerWithoutClient

Conversation

@andrewnicols
Copy link
Copy Markdown
Contributor

We currently use Guzzle for PSR17/PSR7.

We're also now adding in open-telemetry (open-telemetry/exporter-otlp), which makes use of nyholm/psr7-server, but it does not depend on nyholm/psr7.

As a result we now have the Nyholm server request creator, but not the response Factory class.

\Slim\Factory\Psr17\Psr17Factory::isServerRequestCreatorAvailable() returns a truthy value for Nyholm, but when getServerRequestCreator() is called, it errors out.

The Nyholm PSR7 packages are split into a server package, and a client package. Both are required for the NyholmPsr17Factory to be able to return an instance of the ServerRequestCreator class.

This change amends the NyholmPsr17Factory:: isServerRequestCreatorAvailable() method to also check if the response factory class provided by the client package is available.

I can't think of a way of testing this with automated testing. For manual testing you can install nyholm/psr7-server without nyholm/psr7 -- before this change we were hitting an exception.

The Nyholm PSR7 packages are split into a server package, and a client
package. Both are required for the NyholmPsr17Factory to be able to
return an instance of the `ServerRequestCreator` class.
@odan
Copy link
Copy Markdown
Contributor

odan commented Feb 25, 2026

Thanks for the PR. It looks like coveralls.io is not available at the moment: https://status.coveralls.io/
I'll review the PR again once it's back online.

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 1, 2026

Coverage Status

coverage: 99.454% (+0.002%) from 99.452% — andrewnicols:nyholmServerWithoutClient into slimphp:4.x

@andrewnicols
Copy link
Copy Markdown
Contributor Author

Hi @odan,

Coveralls is back up - any chance of a review?

Thanks

@odan
Copy link
Copy Markdown
Contributor

odan commented Apr 4, 2026

@odan odan merged commit 8dea5df into slimphp:4.x Jun 6, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants