WordPress / Requests

Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.
https://requests.ryanmccue.info/
Other
3.57k stars 499 forks source link

More classes planned to be made final #866

Open schlessera opened 8 months ago

schlessera commented 8 months ago

In the next major version of Requests (v3.x), we plan on making more classes final, to simplify the process of keeping in line with the accelerating pace of PHP changes without always incurring the overhead of a BC break.

The v3.x release is still far away on the horizon, but we'd like to get the discussion started as early as possible on this to give affected people a heads-up and hopefully gather more feedback before we pull the trigger on this.

If you can provide any feedback on why or why not some of these classes should be made final, please add a comment on this issue. We're happy to consider valid use cases and make sure we can respect any reasonable extension scenarios.

The following classes are UNDER CONSIDERATION to be made final

We think these are not currently being extended, and making them final will simplify the long-term maintenance work on this package.

Make final? Class name in v2.x Class name in v1.x Notes
no WpOrg\Requests\Requests Requests Keep extensible as last-resort fallback
yes WpOrg\Requests\Cookie Requests_Cookie Direct coupling in WpOrg\Requests\Cookie\Jar
yes WpOrg\Requests\IdnaEncoder Requests_IDNAEncoder Direct coupling in WpOrg\Requests\Requests & WpOrg\Requests\Cookie
yes WpOrg\Requests\Iri Requests_IRI Direct coupling in WpOrg\Requests\Requests & WpOrg\Requests\Cookie\Jar & WpOrg\Requests\Session
yes WpOrg\Requests\Cookie\Jar Requests_Cookie_Jar Direct coupling in WpOrg\Requests\Requests & WpOrg\Requests\Response & WpOrg\Requests\Session
yes WpOrg\Requests\Response\Headers Requests_Response_Headers Direct coupling in WpOrg\Requests\Response

The following classes will NOT be made final

These classes are known to be already extended at this time and will remain as-is for that reason.

Class name in v2.x Class name in v1.x
WpOrg\Requests\Exception Requests_Exception
WpOrg\Requests\Hooks Requests_Hook
WpOrg\Requests\Response Requests_Response
WpOrg\Requests\Session Requests_Session
WpOrg\Requests\Auth\Basic Requests_Auth_Basic
WpOrg\Requests\Utility\CaseInsensitiveDictionary Requests_Utility_CaseInsensitiveDictionary
WpOrg\Requests\Exception\Http Requests_Exception_HTTP
WpOrg\Requests\Exception\Transport Requests_Exception_Transport