Skip to content

Commit 9f1df5b

Browse files
committed
Fix
1 parent 2c6deea commit 9f1df5b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tests/DoctrineIntegration/ORM/EntityManagerIntegrationTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class EntityManagerIntegrationTest extends LevelsTestCase
1414
public function dataTopics(): array
1515
{
1616
$version = InstalledVersions::getVersion('doctrine/dbal');
17-
$hasDbal3 = $version !== null && strpos(InstalledVersions::getVersion('doctrine/dbal'), '3.') === 0;
17+
$hasDbal3 = $version !== null && strpos($version, '3.') === 0;
1818
return [
1919
['entityManagerDynamicReturn'],
2020
['entityManagerMergeReturn'],

tests/DoctrineIntegration/ORM/EntityManagerWithoutObjectManagerLoaderIntegrationTest.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace PHPStan\DoctrineIntegration\ORM;
44

5+
use Composer\InstalledVersions;
56
use PHPStan\Testing\LevelsTestCase;
7+
use function strpos;
68

79
final class EntityManagerWithoutObjectManagerLoaderIntegrationTest extends LevelsTestCase
810
{
@@ -12,11 +14,14 @@ final class EntityManagerWithoutObjectManagerLoaderIntegrationTest extends Level
1214
*/
1315
public function dataTopics(): array
1416
{
17+
$version = InstalledVersions::getVersion('doctrine/dbal');
18+
$hasDbal3 = $version !== null && strpos($version, '3.') === 0;
19+
1520
return [
1621
['entityManagerDynamicReturn'],
1722
['entityManagerMergeReturn'],
1823
['customRepositoryUsage'],
19-
['dbalQueryBuilderExecuteDynamicReturn'],
24+
[$hasDbal3 ? 'dbalQueryBuilderExecuteDynamicReturnDbal3' : 'dbalQueryBuilderExecuteDynamicReturn'],
2025
];
2126
}
2227

0 commit comments

Comments
 (0)