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

PHP 8.0 | File::getMemberProperties(): support mixed type and union types #3011

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Jul 7, 2020

PHP 8.0 will introduce a new pseudo-type mixed as well as union types.

This PR adds tests for these to the File::getMemberProperties() method and makes minor changes to the method to allow for supporting these new type declarations.

Refs:

👉 Important: all sniffs using this method will need to be checked to see if they use the type index and if so, if the check being done needs to take union types into account.

Partially addresses #2968

No changes needed to the actual method, the property type is already handled correctly.
@jrfnl jrfnl mentioned this pull request Jul 7, 2020
jrfnl added 2 commits July 7, 2020 22:07
PHP 8 introduces union types.

This adds support for union types to the `File::getMemberProperties()` method.

Includes extensive unit tests.

Ref: https://wiki.php.net/rfc/union_types_v2
@jrfnl jrfnl force-pushed the feature/2968-getmemberproperties-support-php8-mixed-and-union-types branch from 7fac168 to 46eb56b Compare July 7, 2020 20:09
@jrfnl
Copy link
Contributor Author

jrfnl commented Jul 12, 2020

Test build which includes PR #3014 which confirms that the build for this PR would pass on PHP 8/nightly: https://travis-ci.com/github/jrfnl/PHP_CodeSniffer/jobs/360290605

@jrfnl
Copy link
Contributor Author

jrfnl commented Jul 15, 2020

Closing - this PR is partially replaced by PR #3018 (mixed type) and will for the remainder be replaced by a subsequent PR addressing union types. These have to be pulled in turn as they both add unit tests to the same files. See issue #2968 for the background of why the PR(s) are replaced.

@jrfnl jrfnl closed this Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant