Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 1, 2024
1 parent 6fac80b commit 00439d5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ class MysqliResultRowCountReturnTypeTest extends TypeInferenceTestCase
/** @return iterable<mixed> */
public function dataFileAsserts(): iterable
{
if (InstalledVersions::satisfies(new VersionParser(), 'doctrine/dbal', '>=4.0')) {
$versionParser = new VersionParser();
if (InstalledVersions::satisfies($versionParser, 'doctrine/dbal', '>=4.0')) {
yield from $this->gatherAssertTypes(__DIR__ . '/data/mysqli-result-row-count.php');
} else {
} elseif (InstalledVersions::satisfies($versionParser, 'doctrine/dbal', '>=3.0')) {
yield from $this->gatherAssertTypes(__DIR__ . '/data/mysqli-result-row-count-dbal-3.php');
} else {
yield from $this->gatherAssertTypes(__DIR__ . '/data/mysqli-result-row-count-dbal-2.php');
}
}

Expand Down
15 changes: 15 additions & 0 deletions tests/Type/Doctrine/DBAL/data/mysqli-result-row-count-dbal-2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace MysqliResultRowCountDbal2;

use Doctrine\DBAL\Result;
use Doctrine\DBAL\Driver\Result as DriverResult;
use function PHPStan\Testing\assertType;

function (Result $r): void {
assertType('int|string', $r->rowCount());
};

function (DriverResult $r): void {
assertType('int|string', $r->rowCount());
};

0 comments on commit 00439d5

Please sign in to comment.