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

[NETBEANS-5599] PHP 8.1 Support: Never type #3340

Merged
merged 3 commits into from
Nov 30, 2021

Conversation

junichi11
Copy link
Member

https://issues.apache.org/jira/browse/NETBEANS-5599

RFC: https://wiki.php.net/rfc/noreturn_type

  • Convert from UnusableTypesUnhandledError to UnusableTypesHintError

(Part 1)

  • Add hasNeverType() to PhpVersion
  • Fix the lexer
  • Mark as an error if something is returned when the return type is never
  • Mark as an error if never is used at incorrect places (e.g. private never $propertyType)
  • Add unit tests for the lexer and hints

(Part 2)

  • Fix the code completion
  • Add and fix unit tests for the code completion

Screenshot

nb-php81-never-type

- Use `HintErrorRule` instead of `UnhandledError`
- Add unit tests
https://issues.apache.org/jira/browse/NETBEANS-5599

RFC: https://wiki.php.net/rfc/noreturn_type

- Add `hasNeverType()` to `PhpVersion`
- Fix the lexer
- Mark as an error if something is returned when the return type is `never`
- Mark as an error if `never` is used at incorrect places (e.g. private never $propertyType)
- Add unit tests for the lexer and hints
@junichi11 junichi11 added the PHP [ci] enable extra PHP tests (php/php.editor) label Nov 28, 2021
@junichi11 junichi11 added this to the NB13 milestone Nov 28, 2021
@junichi11
Copy link
Member Author

CI failed: see #3339

@junichi11
Copy link
Member Author

@tmysik Could you please have a look at this? If there is no problem, let's merge it. Thanks.

Copy link
Member

@tmysik tmysik left a comment

Choose a reason for hiding this comment

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

Looks good to me, many unit tests. Thanks for your great work!

@tmysik tmysik merged commit f654361 into apache:php81-support Nov 30, 2021
@junichi11
Copy link
Member Author

Thank you for your review :)

@junichi11 junichi11 deleted the php81-never-type branch November 30, 2021 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants