Skip to content

Commit 0c3565e

Browse files
More sprintf
1 parent 077f28e commit 0c3565e

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

tests/Rules/Doctrine/ORM/EntityColumnRuleTest.php

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -510,23 +510,18 @@ public function testBug659(?string $objectManagerLoader): void
510510

511511
$dbalVersion = InstalledVersions::getVersion('doctrine/dbal');
512512
$hasDbal4 = $dbalVersion !== null && strpos($dbalVersion, '4.') === 0;
513-
if ($hasDbal4) {
514-
$errors = [
515-
[
516-
'Property PHPStan\Rules\Doctrine\ORM\MyEntity659::$binaryResource type mapping mismatch: database can contain string but property expects resource.',
517-
31,
518-
],
519-
];
520-
} else {
521-
$errors = [
522-
[
523-
'Property PHPStan\Rules\Doctrine\ORM\MyEntity659::$binaryString type mapping mismatch: database can contain resource but property expects string.',
524-
25,
525-
],
526-
];
527-
}
528513

529-
$this->analyse([__DIR__ . '/data/bug-659.php'], $errors);
514+
$this->analyse([__DIR__ . '/data/bug-659.php'], [
515+
[
516+
sprintf(
517+
'Property PHPStan\Rules\Doctrine\ORM\MyEntity659::%s type mapping mismatch: database can contain %s but property expects %s.',
518+
$hasDbal4 ? '$binaryResource' : '$binaryString',
519+
$hasDbal4 ? 'string' : 'resource',
520+
$hasDbal4 ? 'resource' : 'string',
521+
),
522+
$hasDbal4 ? 31 : 25,
523+
],
524+
]);
530525
}
531526

532527
}

0 commit comments

Comments
 (0)