Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:replace deprecated HttplugFactory with Psr17Factory #251

Closed
wants to merge 1 commit into from
Closed

fix:replace deprecated HttplugFactory with Psr17Factory #251

wants to merge 1 commit into from

Conversation

BadJacky
Copy link

@BadJacky BadJacky commented Jul 27, 2023

Replace deprecated HttplugFactory with Psr17Factory

Description

HttplugFactory has been deprecated since version 1.8.

This PR replaces all usage of HttplugFactory with the recommended Psr17Factory class.

Changes

  • Replaced all instances of "HttplugFactory" with "Psr17Factory"
  • Removed deprecated HttplugFactory class uses

Checklist

  • Updated CHANGELOG.md
  • Updated documentation

Additional Information

HttplugFactory has been deprecated since version 1.8. Using the deprecated class would cause deprecation warnings. This PR replaces all usage with the recommended Psr17Factory class to avoid warnings and use the latest implementation.

The deprecated HttplugFactory class has been completely removed after replacing all usages.

@dbu
Copy link
Contributor

dbu commented Jul 27, 2023

i think there is a misunderstanding. the Psr7Factory is for the PSR-17 factories, the message factories are for https://github.com/php-http/message factories. the 3 things you change are to discover the legacy php-http factories. the psr7 factory is not a factory for php-http/message things.

people should not try to discover those legacy php-http factories anymore, but the psr17 factories. those are defined in https://github.com/php-http/discovery/blob/1.x/src/Strategy/CommonPsr17ClassesStrategy.php

@dbu dbu closed this Jul 27, 2023
@BadJacky
Copy link
Author

i think there is a misunderstanding. the Psr7Factory is for the PSR-17 factories, the message factories are for https://github.com/php-http/message factories. the 3 things you change are to discover the legacy php-http factories. the psr7 factory is not a factory for php-http/message things.

people should not try to discover those legacy php-http factories anymore, but the psr17 factories. those are defined in https://github.com/php-http/discovery/blob/1.x/src/Strategy/CommonPsr17ClassesStrategy.php

I believe I've grasped your intentions.

Upon inspecting the Nyholm/Psr7 package, I have concluded that this does not present a backward compatibility issue.

Additionally, I wanted to inquire about our current use of deprecated classes within the project. Could we possibly consider eliminating them?

@dbu
Copy link
Contributor

dbu commented Jul 27, 2023

one should not use MessageFactoryDiscovery / MessageFactoryDiscovery / UriFactoryDiscovery anymore, but the Psr17FactoryDiscovery to get psr17 factories for those psr7 items. the old factories had been done when psr17 did not exist yet and have all been deprecated in favor of psr17

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.

2 participants