diff --git a/src/Reflection/ReflectionNamedType.php b/src/Reflection/ReflectionNamedType.php index c5a5fe9e1..a20012438 100644 --- a/src/Reflection/ReflectionNamedType.php +++ b/src/Reflection/ReflectionNamedType.php @@ -27,6 +27,7 @@ class ReflectionNamedType extends ReflectionType 'mixed' => null, 'static' => null, 'null' => null, + 'never' => null, ]; private string $name; diff --git a/test/unit/Reflection/ReflectionTypeTest.php b/test/unit/Reflection/ReflectionTypeTest.php index 21052c8a7..8f8632b7e 100644 --- a/test/unit/Reflection/ReflectionTypeTest.php +++ b/test/unit/Reflection/ReflectionTypeTest.php @@ -50,6 +50,7 @@ public function isBuildinProvider(): Generator yield ['object']; yield ['iterable']; yield ['mixed']; + yield ['never']; } /** @@ -92,6 +93,7 @@ public function testImplicitCastToString(): void self::assertSame('object', (string) ReflectionType::createFromTypeAndReflector(new Identifier('object'))); self::assertSame('iterable', (string) ReflectionType::createFromTypeAndReflector(new Identifier('iterable'))); self::assertSame('mixed', (string) ReflectionType::createFromTypeAndReflector(new Identifier('mixed'))); + self::assertSame('never', (string) ReflectionType::createFromTypeAndReflector(new Identifier('never'))); self::assertSame('Foo\Bar\Baz', (string) ReflectionType::createFromTypeAndReflector(new Identifier('Foo\Bar\Baz'))); self::assertSame('\Foo\Bar\Baz', (string) ReflectionType::createFromTypeAndReflector(new Identifier('\Foo\Bar\Baz')));