1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Type;
4:
5: use PHPStan\TrinaryLogic;
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): TrinaryLogic
18: {
19: if ($type instanceof self) {
20: return TrinaryLogic::createYes();
21: }
22: if ($type instanceof parent) {
23: return TrinaryLogic::createMaybe();
24: }
25:
26: return TrinaryLogic::createNo();
27: }
28:
29: public function acceptsWithReason(Type $type, bool $strictTypes): AcceptsResult
30: {
31: if ($type instanceof NeverType) {
32: return AcceptsResult::createYes();
33: }
34:
35: return AcceptsResult::createNo();
36: }
37:
38: public function describe(VerbosityLevel $level): string
39: {
40: return 'never';
41: }
42:
43: }
44: