Skip to content

Commit 00439d5

Browse files
committed
Fix build
1 parent 6fac80b commit 00439d5

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

tests/Type/Doctrine/DBAL/MysqliResultRowCountReturnTypeTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ class MysqliResultRowCountReturnTypeTest extends TypeInferenceTestCase
1212
/** @return iterable<mixed> */
1313
public function dataFileAsserts(): iterable
1414
{
15-
if (InstalledVersions::satisfies(new VersionParser(), 'doctrine/dbal', '>=4.0')) {
15+
$versionParser = new VersionParser();
16+
if (InstalledVersions::satisfies($versionParser, 'doctrine/dbal', '>=4.0')) {
1617
yield from $this->gatherAssertTypes(__DIR__ . '/data/mysqli-result-row-count.php');
17-
} else {
18+
} elseif (InstalledVersions::satisfies($versionParser, 'doctrine/dbal', '>=3.0')) {
1819
yield from $this->gatherAssertTypes(__DIR__ . '/data/mysqli-result-row-count-dbal-3.php');
20+
} else {
21+
yield from $this->gatherAssertTypes(__DIR__ . '/data/mysqli-result-row-count-dbal-2.php');
1922
}
2023
}
2124

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace MysqliResultRowCountDbal2;
4+
5+
use Doctrine\DBAL\Result;
6+
use Doctrine\DBAL\Driver\Result as DriverResult;
7+
use function PHPStan\Testing\assertType;
8+
9+
function (Result $r): void {
10+
assertType('int|string', $r->rowCount());
11+
};
12+
13+
function (DriverResult $r): void {
14+
assertType('int|string', $r->rowCount());
15+
};

0 commit comments

Comments
 (0)