1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Type;
4:
5: use PHPStan\Type\Generic\TemplateType;
6:
7: /** @api */
8: class NonAcceptingNeverType extends NeverType
9: {
10:
11: /** @api */
12: public function __construct()
13: {
14: parent::__construct(true);
15: }
16:
17: public function isSuperTypeOf(Type $type): IsSuperTypeOfResult
18: {
19: if ($type instanceof self) {
20: return IsSuperTypeOfResult::createYes();
21: }
22: if ($type instanceof parent) {
23: return IsSuperTypeOfResult::createMaybe();
24: }
25:
26: if ($type instanceof TemplateType) {
27: return IsSuperTypeOfResult::createMaybe();
28: }
29:
30: return IsSuperTypeOfResult::createNo();
31: }
32:
33: public function accepts(Type $type, bool $strictTypes): AcceptsResult
34: {
35: if ($type instanceof NeverType) {
36: return AcceptsResult::createYes();
37: }
38:
39: return AcceptsResult::createNo();
40: }
41:
42: public function describe(VerbosityLevel $level): string
43: {
44: return 'never';
45: }
46:
47: }
48: