dns icon indicating copy to clipboard operation
dns copied to clipboard

Add native types to public API

Open WyriHaximus opened this issue 1 year ago • 3 comments

This changeset adds native types to the public API as discussed in #219.

Once merged, I'm planning to add PHPStan in a follow-up PR which would take advantage of these types.

Builds on top of #222, #223 and reactphp/cache#60

WyriHaximus avatar May 27 '24 14:05 WyriHaximus

First round of review is done, found a few things that I commented on.

Sweet, thanks! Made all the updates locally. But will push them all in one go once I've also done your other comment.

I also went through all classes to be sure we don't miss anything and noticed that these following classes are missing types on their public functions:

  • Model/Message
  • Protocol/BinaryDumper
  • Protocol/Parser
  • Query/Query
  • Query/RetryExecutor

Last time I checked, those classes aren't part of our public API, except the Query/RetryExecutor. 🤣🤐🤦(But yes I'll add public types to those as well.)

WyriHaximus avatar Jun 12 '24 14:06 WyriHaximus

Last time I checked, those classes aren't part of our public API, except the Query/RetryExecutor. 🤣🤐🤦(But yes I'll add public types to those as well.)

@WyriHaximus Yeah, I also talked with @clue what would count as public API and I think everything that isn't marked as internal or private. Except we recommend not using certain public functions in our README, but didn't find anything about this in our documentation.

Maybe there were some decisions made back in the days but never documented, which makes it hard for me to differentiate it from the rest of the public API.

SimonFrings avatar Jun 13 '24 06:06 SimonFrings

Last time I checked, those classes aren't part of our public API, except the Query/RetryExecutor. 🤣🤐🤦(But yes I'll add public types to those as well.)

@WyriHaximus Yeah, I also talked with @clue what would count as public API and I think everything that isn't marked as internal or private. Except we recommend not using certain public functions in our README, but didn't find anything about this in our documentation.

That was my assumption. But it's fine, it would have been added in the followup PR anyway.

Maybe there were some decisions made back in the days but never documented, which makes it hard for me to differentiate it from the rest of the public API.

Not really, it was an assumption, and the previous packages where so small everything was the public API in both ways.

WyriHaximus avatar Jun 13 '24 06:06 WyriHaximus