Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return types properly with disjunctive normal form #567

Conversation

fredden
Copy link
Member

@fredden fredden commented Mar 15, 2024

I've been down a rabbit hole today. I started with PHPCompatibility/PHPCompatibility#1689 and then found #566 and am now here to return the proper type information for disjunctive normal form parameters. I have included a reference to PHPCSStandards/PHP_CodeSniffer#387 as there is a bug in PHP_CodeSniffer itself where the union operator for a disjunctive normal form is sometimes tokenised as T_BITWISE_OR. If you would prefer, I can remove that work-around from this pull request and wait until PHPCSStandards/PHP_CodeSniffer#387 is fixed instead.

@jrfnl
Copy link
Member

jrfnl commented Mar 16, 2024

This patch would be completely invalidated by the proposed patch for PHPCSStandards/PHP_CodeSniffer#387.

Also, the tests are not in the right place. For those very select situations where PHPCSUtils would be ahead of PHPCS for fixes to the "mirror"-methods, the tests for the "difference" should be handled in the GetParametersDiffTest class (and moved to the BCFile/GetMethodParametersTest class once the upstream PR would have been merged to sync with upstream again).

@fredden fredden force-pushed the function-get-params/disjunctive-normal-form branch from 0fa04d6 to f6a6111 Compare March 18, 2024 14:29
@jrfnl jrfnl closed this in #604 May 20, 2024
@fredden fredden deleted the function-get-params/disjunctive-normal-form branch May 20, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants