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 2828use PHPStan \Type \Doctrine \ObjectMetadataResolver ;
2929use function array_unshift ;
3030use function class_exists ;
31+ use function sprintf ;
3132use function strpos ;
3233use const PHP_VERSION_ID ;
3334
@@ -274,23 +275,16 @@ public function testSuperclass(?string $objectManagerLoader): void
274275
275276 $ dbalVersion = InstalledVersions::getVersion ('doctrine/dbal ' );
276277 $ 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- }
292278
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+ ]);
294288 }
295289
296290 /**
You can’t perform that action at this time.
0 commit comments