File tree Expand file tree Collapse file tree 1 file changed +10
-16
lines changed Expand file tree Collapse file tree 1 file changed +10
-16
lines changed Original file line number Diff line number Diff line change 28
28
use PHPStan \Type \Doctrine \ObjectMetadataResolver ;
29
29
use function array_unshift ;
30
30
use function class_exists ;
31
+ use function sprintf ;
31
32
use function strpos ;
32
33
use const PHP_VERSION_ID ;
33
34
@@ -274,23 +275,16 @@ public function testSuperclass(?string $objectManagerLoader): void
274
275
275
276
$ dbalVersion = InstalledVersions::getVersion ('doctrine/dbal ' );
276
277
$ hasDbal4 = $ dbalVersion !== null && strpos ($ dbalVersion , '4. ' ) === 0 ;
277
- if ($ hasDbal4 ) {
278
- $ errors = [
279
- [
280
- 'Property PHPStan\Rules\Doctrine\ORM\MyBrokenSuperclass::$five type mapping mismatch: database can contain string but property expects int. ' ,
281
- 17 ,
282
- ],
283
- ];
284
- } else {
285
- $ errors = [
286
- [
287
- 'Property PHPStan\Rules\Doctrine\ORM\MyBrokenSuperclass::$five type mapping mismatch: database can contain resource but property expects int. ' ,
288
- 17 ,
289
- ],
290
- ];
291
- }
292
278
293
- $ this ->analyse ([__DIR__ . '/data/MyBrokenSuperclass.php ' ], $ errors );
279
+ $ this ->analyse ([__DIR__ . '/data/MyBrokenSuperclass.php ' ], [
280
+ [
281
+ sprintf (
282
+ 'Property PHPStan\Rules\Doctrine\ORM\MyBrokenSuperclass::$five type mapping mismatch: database can contain %s but property expects int. ' ,
283
+ $ hasDbal4 ? 'string ' : 'resource ' ,
284
+ ),
285
+ 17 ,
286
+ ],
287
+ ]);
294
288
}
295
289
296
290
/**
You can’t perform that action at this time.
0 commit comments