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 494 forks source link

Review parameter type declarations #873

Open jrfnl opened 3 months ago

jrfnl commented 3 months ago

While looking at something different, we noticed a number of places where parameters did not have (non-scalar) type declarations, while they could have.

It would probably be a good idea to do a review of the complete codebase to add object-based/array type declarations wherever possible.

This would not be a breaking change as overloading methods not having a type declaration, means those are declared as mixed and mixed is contravariant with any type, so this would not lead to signature mismatch errors.

jrfnl commented 3 months ago

Currently having a prelim look at this and I am now doubting we can actually do this in a minor as certain code would either:

With that in mind, I'm moving this to the 3.0 milestone.