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
Update test expectations for class-string value-level descriptions
Tests now expect class-string<ClassName> instead of quoted 'ClassName'
when ConstantStringType with isClassString flag is described at value
verbosity level. Also update baseline and ignored error patterns.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
'Parameter $repositoryClass of attribute class Bug7171\Entity constructor expects class-string<Bug7171\EntityRepository<T of object>>|null, \'stdClass\' given.',
153
+
'Parameter $repositoryClass of attribute class Bug7171\Entity constructor expects class-string<Bug7171\EntityRepository<T of object>>|null, class-string<stdClass> given.',
Copy file name to clipboardExpand all lines: tests/PHPStan/Rules/Comparison/ImpossibleCheckTypeFunctionCallRuleTest.php
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -160,7 +160,7 @@ public function testImpossibleCheckTypeFunctionCall(): void
160
160
582,
161
161
],
162
162
[
163
-
'Call to function method_exists() with \'CheckTypeFunctionCall\\\\MethodExists\' and \'testWithStringFirst…\' will always evaluate to true.',
163
+
'Call to function method_exists() with class-string<CheckTypeFunctionCall\\MethodExists> and \'testWithStringFirst…\' will always evaluate to true.',
164
164
596,
165
165
],
166
166
[
@@ -196,30 +196,30 @@ public function testImpossibleCheckTypeFunctionCall(): void
196
196
656,
197
197
],
198
198
[
199
-
'Call to function method_exists() with \'CheckTypeFunctionCall\\\\MethodExistsWithTrait\' and \'method\' will always evaluate to true.',
199
+
'Call to function method_exists() with class-string<CheckTypeFunctionCall\MethodExistsWithTrait> and \'method\' will always evaluate to true.',
200
200
659,
201
201
'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%</>.',
202
202
],
203
203
[
204
-
'Call to function method_exists() with \'CheckTypeFunctionCall\\\\MethodExistsWithTrait\' and \'someAnother\' will always evaluate to true.',
204
+
'Call to function method_exists() with class-string<CheckTypeFunctionCall\MethodExistsWithTrait> and \'someAnother\' will always evaluate to true.',
205
205
662,
206
206
'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%</>.',
207
207
],
208
208
[
209
-
'Call to function method_exists() with \'CheckTypeFunctionCall\\\\MethodExistsWithTrait\' and \'unknown\' will always evaluate to false.',
209
+
'Call to function method_exists() with class-string<CheckTypeFunctionCall\MethodExistsWithTrait> and \'unknown\' will always evaluate to false.',
210
210
665,
211
211
'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%</>.',
212
212
],
213
213
[
214
-
'Call to function method_exists() with \'CheckTypeFunctionCall\\\\MethodExistsWithTrait\' and \'method\' will always evaluate to true.',
214
+
'Call to function method_exists() with class-string<CheckTypeFunctionCall\MethodExistsWithTrait> and \'method\' will always evaluate to true.',
215
215
668,
216
216
],
217
217
[
218
-
'Call to function method_exists() with \'CheckTypeFunctionCall\\\\MethodExistsWithTrait\' and \'someAnother\' will always evaluate to true.',
218
+
'Call to function method_exists() with class-string<CheckTypeFunctionCall\MethodExistsWithTrait> and \'someAnother\' will always evaluate to true.',
219
219
671,
220
220
],
221
221
[
222
-
'Call to function method_exists() with \'CheckTypeFunctionCall\\\\MethodExistsWithTrait\' and \'unknown\' will always evaluate to false.',
222
+
'Call to function method_exists() with class-string<CheckTypeFunctionCall\MethodExistsWithTrait> and \'unknown\' will always evaluate to false.',
223
223
674,
224
224
],
225
225
[
@@ -391,11 +391,11 @@ public function testBug6305(): void
"Call to function is_subclass_of() with arguments Bug13713\\test, 'stdClass' and false will always evaluate to true.",
415
+
"Call to function is_subclass_of() with arguments Bug13713\\test, class-string<stdClass> and false will always evaluate to true.",
416
416
12,
417
417
],
418
418
[
419
-
"Call to function is_subclass_of() with arguments class-string<Bug13713\\test>, 'stdClass' and true will always evaluate to true.",
419
+
"Call to function is_subclass_of() with arguments class-string<Bug13713\\test>, class-string<stdClass> and true will always evaluate to true.",
420
420
25,
421
421
'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%</>.',
422
422
],
@@ -1004,7 +1004,7 @@ public function testBugPR3404(): void
Copy file name to clipboardExpand all lines: tests/PHPStan/Rules/Functions/CallCallablesRuleTest.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -148,22 +148,22 @@ public function testRule(): void
148
148
176,
149
149
],
150
150
[
151
-
'Trying to invoke array{\'CallCallables\\\\CallableInForeach\', \'bar\'|\'foo\'} but it might not be a callable.',
151
+
'Trying to invoke array{class-string<CallCallables\\CallableInForeach>, \'bar\'|\'foo\'} but it might not be a callable.',
152
152
188,
153
153
],
154
154
[
155
-
'Trying to invoke array{\'CallCallables\\\\ConstantArrayUnionCallables\'|\'DateTimeImmutable\', \'doFoo\'} but it might not be a callable.',
155
+
'Trying to invoke array{class-string<CallCallables\\ConstantArrayUnionCallables>|class-string<DateTimeImmutable>, \'doFoo\'} but it might not be a callable.',
156
156
214,
157
157
],
158
158
[
159
-
'Trying to invoke array{\'CallCallables\\\ConstantArrayUnionCallables\', \'doBaz\'|\'doFoo\'} but it might not be a callable.',
159
+
'Trying to invoke array{class-string<CallCallables\\ConstantArrayUnionCallables>, \'doBaz\'|\'doFoo\'} but it might not be a callable.',
160
160
221,
161
161
],
162
162
];
163
163
164
164
if (PHP_VERSION_ID >= 80000) {
165
165
$errors[] = [
166
-
'Trying to invoke array{\'CallCallables\\\ConstantArrayUnionCallables\'|\'CallCallables\\\ConstantArrayUnionCallablesTest\', \'doBar\'|\'doFoo\'} but it\'s not a callable.',
166
+
'Trying to invoke array{class-string<CallCallables\\ConstantArrayUnionCallables>|class-string<CallCallables\\ConstantArrayUnionCallablesTest>, \'doBar\'|\'doFoo\'} but it\'s not a callable.',
0 commit comments