Skip to content

Add native types to public API - #225

Open
WyriHaximus wants to merge 1 commit into
reactphp:3.xfrom
WyriHaximus-labs:3.x-public-API-types
Open

Add native types to public API#225
WyriHaximus wants to merge 1 commit into
reactphp:3.xfrom
WyriHaximus-labs:3.x-public-API-types

Conversation

@WyriHaximus

Copy link
Copy Markdown
Member

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

@WyriHaximusWyriHaximus added this to the v3.0.0 milestone May 27, 2024
@WyriHaximus
WyriHaximusforce-pushed the 3.x-public-API-types branch from fb61ef0 to b25a4dfCompareMay 27, 2024 16:03
@WyriHaximus
WyriHaximus marked this pull request as ready for review May 27, 2024 16:42
@WyriHaximusWyriHaximus changed the title [WIP] Add native types to public APIAdd native types to public APIMay 27, 2024
@WyriHaximus
WyriHaximusforce-pushed the 3.x-public-API-types branch from b25a4df to 9ea8a4bCompareJune 5, 2024 12:34

@SimonFringsSimonFrings left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First round of review is done, found a few things that I commented on. 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

Comment threadsrc/Config/HostsFile.php Outdated
Comment threadsrc/Config/HostsFile.php
Comment threadsrc/Config/HostsFile.php Outdated
Comment threadsrc/Config/HostsFile.php Outdated
Comment threadsrc/Config/HostsFile.php Outdated
Comment threadsrc/Model/Record.php Outdated
Comment threadsrc/Query/CachingExecutor.php Outdated
Comment threadsrc/Query/TcpTransportExecutor.php
Comment threadsrc/Query/TcpTransportExecutor.php Outdated
Comment threadsrc/Query/UdpTransportExecutor.php
@WyriHaximus

WyriHaximus commented Jun 12, 2024

Copy link
Copy Markdown
MemberAuthor

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
WyriHaximusforce-pushed the 3.x-public-API-types branch from 9ea8a4b to 6c7b3afCompareJune 13, 2024 05:49
@SimonFrings

Copy link
Copy Markdown
Member

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.

@WyriHaximus

Copy link
Copy Markdown
MemberAuthor

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
WyriHaximusforce-pushed the 3.x-public-API-types branch 3 times, most recently from 7e4dfbf to ab9fc67CompareJune 13, 2024 16:23

@SimonFringsSimonFrings left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates, found a few minor things, should be quick fixes 👍

Comment threadsrc/Model/Message.php
Comment threadsrc/Model/Message.php
Comment threadsrc/Model/Record.php
Comment threadsrc/Query/TcpTransportExecutor.php Outdated
@WyriHaximus
WyriHaximusforce-pushed the 3.x-public-API-types branch from ab9fc67 to 1e20620CompareJune 14, 2024 10:33
This changeset adds native types to the public API as discussed in reactphp#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 reactphp#222, reactphp#223 and reactphp/cache#60

@SimonFringsSimonFrings left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, PR looks good to me 👍

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@WyriHaximus@SimonFrings