File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ final class TypeResolver
107107 'static ' => Types \Static_::class,
108108 'parent ' => Types \Parent_::class,
109109 'iterable ' => Types \Iterable_::class,
110+ 'never ' => Types \Never_::class,
110111 ];
111112
112113 /**
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /**
6+ * This file is part of phpDocumentor.
7+ *
8+ * For the full copyright and license information, please view the LICENSE
9+ * file that was distributed with this source code.
10+ *
11+ * @link http://phpdoc.org
12+ */
13+
14+ namespace phpDocumentor \Reflection \Types ;
15+
16+ use phpDocumentor \Reflection \Type ;
17+
18+ /**
19+ * Value Object representing the pseudo-type 'never'.
20+ *
21+ * Never is generally only used when working with return types as it signifies that the method that only
22+ * ever throw or exit.
23+ *
24+ * @psalm-immutable
25+ */
26+ final class Never_ implements Type
27+ {
28+ /**
29+ * Returns a rendered output of the Type as it would be used in a DocBlock.
30+ */
31+ public function __toString (): string
32+ {
33+ return 'never ' ;
34+ }
35+ }
Original file line number Diff line number Diff line change @@ -757,6 +757,7 @@ public function provideKeywords(): array
757757 ['self ' , Types \Self_::class],
758758 ['parent ' , Types \Parent_::class],
759759 ['iterable ' , Types \Iterable_::class],
760+ ['never ' , Types \Never_::class],
760761 ];
761762 }
762763
You can’t perform that action at this time.
0 commit comments