You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sprintf('PHPDoc tag %s for %s contains generic type %%s but %%s %%s is not generic.', $tagName, $assertedExprString),
171
+
sprintf('Generic type %%s in PHPDoc tag %s for %s does not specify all template types of %%s %%s: %%s', $tagName, $assertedExprString),
172
+
sprintf('Generic type %%s in PHPDoc tag %s for %s specifies %%d template types, but %%s %%s supports only %%d: %%s', $tagName, $assertedExprString),
173
+
sprintf('Type %%s in generic type %%s in PHPDoc tag %s for %s is not subtype of template type %%s of %%s %%s.', $tagName, $assertedExprString),
174
+
sprintf('Call-site variance of %%s in generic type %%s in PHPDoc tag %s for %s is in conflict with %%s template type %%s of %%s %%s.', $tagName, $assertedExprString),
175
+
sprintf('Call-site variance of %%s in generic type %%s in PHPDoc tag %s for %s is redundant, template type %%s of %%s %%s has the same variance.', $tagName, $assertedExprString),
176
+
));
177
+
178
+
if (!$this->checkMissingTypehints) {
179
+
continue;
180
+
}
72
181
73
-
if ($assert->isNegated() ? $isSuperType->yes() : $isSuperType->no()) {
@@ -54,6 +70,67 @@ public function testRule(): void
54
70
'Asserted negated type string for $i with type int does not narrow down the type.',
55
71
72,
56
72
],
73
+
[
74
+
'PHPDoc tag @phpstan-assert for $this->fooProp contains unresolvable type.',
75
+
94,
76
+
],
77
+
[
78
+
'PHPDoc tag @phpstan-assert-if-true for $a contains unresolvable type.',
79
+
94,
80
+
],
81
+
[
82
+
'PHPDoc tag @phpstan-assert for $a contains unknown class MethodAssert\Nonexistent.',
83
+
105,
84
+
],
85
+
[
86
+
'PHPDoc tag @phpstan-assert for $b contains invalid type MethodAssert\FooTrait.',
87
+
105,
88
+
],
89
+
[
90
+
'Class MethodAssert\Foo referenced with incorrect case: MethodAssert\fOO.',
91
+
105,
92
+
],
93
+
[
94
+
'Assert references unknown $this->barProp.',
95
+
105,
96
+
],
97
+
[
98
+
'Assert references unknown parameter $this.',
99
+
113,
100
+
],
101
+
[
102
+
'PHPDoc tag @phpstan-assert for $m contains generic type Exception<int, float> but class Exception is not generic.',
103
+
131,
104
+
],
105
+
[
106
+
'Generic type MethodAssert\FooBar<mixed> in PHPDoc tag @phpstan-assert for $m does not specify all template types of class MethodAssert\FooBar: T, TT',
107
+
138,
108
+
],
109
+
[
110
+
'Type mixed in generic type MethodAssert\FooBar<mixed> in PHPDoc tag @phpstan-assert for $m is not subtype of template type T of int of class MethodAssert\FooBar.',
111
+
138,
112
+
],
113
+
[
114
+
'Generic type MethodAssert\FooBar<int> in PHPDoc tag @phpstan-assert for $m does not specify all template types of class MethodAssert\FooBar: T, TT',
115
+
145,
116
+
],
117
+
[
118
+
'Generic type MethodAssert\FooBar<int, string, float> in PHPDoc tag @phpstan-assert for $m specifies 3 template types, but class MethodAssert\FooBar supports only 2: T, TT',
119
+
152,
120
+
],
121
+
[
122
+
'PHPDoc tag @phpstan-assert for $m has no value type specified in iterable type array.',
0 commit comments