Skip to content

Support intersection types (PHP 8.1+ / ported from v2 to v3) - #209

Merged
WyriHaximus merged 2 commits into
reactphp:masterfrom
bzikarsky:bz/union-types-v3
Feb 5, 2022
Merged

Support intersection types (PHP 8.1+ / ported from v2 to v3)#209
WyriHaximus merged 2 commits into
reactphp:masterfrom
bzikarsky:bz/union-types-v3

Conversation

@bzikarsky

Copy link
Copy Markdown
Contributor

See #195 for details.

Unrelated: I fixed an E_DEPRECATED on 8.1 in RejectedPromiseTest (Deprecated: Exception::__construct(): Passing null to parameter #1 ($message) of type string is deprecated in /code/tests/Internal/RejectedPromiseTest.php on line 40) - Are you fine with adding this in an additional commit to the PR or do you want to have a separate PR (and more rebase action)?

@clueclue changed the title Port union-type support in _checkTypehint from v2 to v3Support intersection types (PHP 8.1+ / ported from v2 to v3)Feb 5, 2022

@clueclue 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.

@bzikarsky Thank you for taking over and porting this also to Promise v3! 👍

The changes LGTM, but I've noticed some potential to simplify this given we can finally(!) rely on more recent PHP features (#149). Can you look into this?

Comment threadsrc/functions.php Outdated
Comment threadtests/FunctionCheckTypehintTest.php Outdated
@clue

clue commented Feb 5, 2022

Copy link
Copy Markdown
Member

Unrelated: I fixed an E_DEPRECATED on 8.1 in RejectedPromiseTest (Deprecated: Exception::__construct(): Passing null to parameter #1 ($message) of type string is deprecated in /code/tests/Internal/RejectedPromiseTest.php on line 40) - Are you fine with adding this in an additional commit to the PR or do you want to have a separate PR (and more rebase action)?

@bzikarsky I can indeed see the same error on PHP 8.1 (#199) and you're right that this seems to be unrelated to this PR, so perhaps better file this as a separate PR? :shipit:

@bzikarsky

Copy link
Copy Markdown
ContributorAuthor

Thanks @clue for going over it.

Those 7.1 related simplifications make sense and I can also supply that extra fix in a separate PR. It may have to wait until Monday though - depending on what my family is up to over the weekend. 🙂

@bzikarsky

Copy link
Copy Markdown
ContributorAuthor

Improvements are in. 🙂

Unrelated: I fixed an E_DEPRECATED on 8.1 in RejectedPromiseTest (Deprecated: Exception::__construct(): Passing null to parameter #1 ($message) of type string is deprecated in /code/tests/Internal/RejectedPromiseTest.php on line 40) - Are you fine with adding this in an additional commit to the PR or do you want to have a separate PR (and more rebase action)?

@bzikarsky I can indeed see the same error on PHP 8.1 (#199) and you're right that this seems to be unrelated to this PR, so perhaps better file this as a separate PR? :shipit:

PR is at #210.

clue
clue approved these changes Feb 5, 2022

@clueclue 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.

@bzikarsky Thanks for the update, changes LGTM, keep it up! :shipit:

@clueclue added this to the v3.0.0 milestone Feb 5, 2022
jsor
jsor approved these changes Feb 5, 2022
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.

4 participants

@bzikarsky@clue@jsor@WyriHaximus