Skip to content

Commit c86190e

Browse files
authored
Merge pull request #660 from emacs-php/feature/php8-never-type
Add never native type for PHP 8.1
2 parents a2bca9b + 9917fdb commit c86190e

File tree

3 files changed

+239
-67
lines changed

3 files changed

+239
-67
lines changed

lisp/php-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ In that case set to `NIL'."
481481

482482
(c-lang-defconst c-primitive-type-kwds
483483
php '("int" "integer" "bool" "boolean" "float" "double" "real"
484-
"string" "object" "void" "mixed"))
484+
"string" "object" "void" "mixed" "never"))
485485

486486
(c-lang-defconst c-class-decl-kwds
487487
"Keywords introducing declarations where the following block (if any)

tests/type-hints.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,8 @@ public function getCallable(
154154
public function getNullableCallable(
155155
): ?callable {
156156
}
157+
158+
public function neverReturn(
159+
): never {
160+
}
157161
}

0 commit comments

Comments
 (0)