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
Copy file name to clipboardExpand all lines: tests/Type/WebMozartAssert/ImpossibleCheckTypeMethodCallRuleTest.php
+11
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,8 @@ protected function getRule(): Rule
19
19
20
20
publicfunctiontestExtension(): void
21
21
{
22
+
$tipText = 'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.';
'Call to static method Webmozart\Assert\Assert::stringNotEmpty() with \'\' will always evaluate to false.',
@@ -92,10 +94,12 @@ public function testExtension(): void
92
94
[
93
95
'Call to static method Webmozart\Assert\Assert::implementsInterface() with class-string<WebmozartAssertImpossibleCheck\Bar>|WebmozartAssertImpossibleCheck\Bar and \'WebmozartAssertImpossibleCheck\\\Bar\' will always evaluate to true.',
94
96
105,
97
+
$tipText,
95
98
],
96
99
[
97
100
'Call to static method Webmozart\Assert\Assert::implementsInterface() with class-string<WebmozartAssertImpossibleCheck\Bar> and \'WebmozartAssertImpossibleCheck\\\Bar\' will always evaluate to true.',
98
101
108,
102
+
$tipText,
99
103
],
100
104
[
101
105
'Call to static method Webmozart\Assert\Assert::implementsInterface() with mixed and \'WebmozartAssertImpossibleCheck\\\Foo\' will always evaluate to false.',
@@ -104,6 +108,7 @@ public function testExtension(): void
104
108
[
105
109
'Call to static method Webmozart\Assert\Assert::isInstanceOf() with Exception and class-string<Exception> will always evaluate to true.',
106
110
119,
111
+
$tipText,
107
112
],
108
113
[
109
114
'Call to static method Webmozart\Assert\Assert::startsWith() with \'value\' and string will always evaluate to true.',
@@ -184,28 +189,34 @@ public function testEqNotEq(): void
184
189
185
190
publicfunctiontestBug8(): void
186
191
{
192
+
$tipText = 'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.';
187
193
$this->analyse([__DIR__ . '/data/bug-8.php'], [
188
194
[
189
195
'Call to static method Webmozart\Assert\Assert::numeric() with numeric-string will always evaluate to true.',
190
196
15,
197
+
$tipText,
191
198
],
192
199
[
193
200
'Call to static method Webmozart\Assert\Assert::numeric() with \'foo\' will always evaluate to false.',
194
201
16,
202
+
$tipText,
195
203
],
196
204
[
197
205
'Call to static method Webmozart\Assert\Assert::numeric() with \'17.19\' will always evaluate to true.',
198
206
17,
207
+
$tipText,
199
208
],
200
209
]);
201
210
}
202
211
203
212
publicfunctiontestBug17(): void
204
213
{
214
+
$tipText = 'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.';
205
215
$this->analyse([__DIR__ . '/data/bug-17.php'], [
206
216
[
207
217
'Call to static method Webmozart\Assert\Assert::implementsInterface() with \'DateTime\' and \'DateTimeInterface\' will always evaluate to true.',
0 commit comments