File tree 4 files changed +38
-1
lines changed
4 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ final class TypeResolver
107
107
'static ' => Types \Static_::class,
108
108
'parent ' => Types \Parent_::class,
109
109
'iterable ' => Types \Iterable_::class,
110
+ 'never ' => Types \Never_::class,
110
111
];
111
112
112
113
/**
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 return-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 16
16
use phpDocumentor \Reflection \Type ;
17
17
18
18
/**
19
- * Value Object representing the pseudo -type 'void'.
19
+ * Value Object representing the return -type 'void'.
20
20
*
21
21
* Void is generally only used when working with return types as it signifies that the method intentionally does not
22
22
* return any value.
Original file line number Diff line number Diff line change @@ -757,6 +757,7 @@ public function provideKeywords(): array
757
757
['self ' , Types \Self_::class],
758
758
['parent ' , Types \Parent_::class],
759
759
['iterable ' , Types \Iterable_::class],
760
+ ['never ' , Types \Never_::class],
760
761
];
761
762
}
762
763
You can’t perform that action at this time.
0 commit comments