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

Propose never type #1191

Merged
merged 2 commits into from Apr 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion proposed/phpdoc.md
Expand Up @@ -461,7 +461,7 @@ A Type has the following [ABNF][RFC5234] definition:
class-name = ["\"] label *("\" label)
label = (ALPHA / %x7F-FF) *(ALPHA / DIGIT / %x7F-FF)
keyword = "array" / "bool" / "callable" / "false" / "float" / "int" / "iterable" / "mixed" / "null" / "object" /
keyword = "resource" / "self" / "static" / "string" / "true" / "void" / "$this"
keyword = "resource" / "self" / "static" / "string" / "true" / "void" / "$this" / "never"

### Details

Expand Down Expand Up @@ -659,6 +659,9 @@ The following keywords are recognized by this PSR:

This type is often used as return value for methods implementing the [Fluent Interface][FLUENT] design pattern.

17. `never`: denotes that element isn't going to return anything and always throws exception or terminates
the program abnormally (such as by calling the library function `exit`).

[RFC2119]: https://tools.ietf.org/html/rfc2119
[RFC5234]: https://tools.ietf.org/html/rfc5234
[PHP_RESOURCE]: https://php.net/manual/language.types.resource.php
Expand Down