From 8eb194ea1f8b9f77a51df28c865a2d84cfc6c7cb Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 25 Apr 2021 22:35:28 +0200 Subject: [PATCH] Add never type This should be recognized as Identifier instead of Name now. --- lib/PhpParser/ParserAbstract.php | 1 + test/code/parser/stmt/function/neverType.test | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 test/code/parser/stmt/function/neverType.test diff --git a/lib/PhpParser/ParserAbstract.php b/lib/PhpParser/ParserAbstract.php index 0600b98..c61208b 100644 --- a/lib/PhpParser/ParserAbstract.php +++ b/lib/PhpParser/ParserAbstract.php @@ -663,6 +663,7 @@ abstract class ParserAbstract implements Parser 'null' => true, 'false' => true, 'mixed' => true, + 'never' => true, ]; if (!$name->isUnqualified()) { diff --git a/test/code/parser/stmt/function/neverType.test b/test/code/parser/stmt/function/neverType.test new file mode 100644 index 0000000..7842e8a --- /dev/null +++ b/test/code/parser/stmt/function/neverType.test @@ -0,0 +1,23 @@ +Never type +----- +