Skip to content

Commit

Permalink
try reproduce bug #394
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Oct 29, 2022
1 parent 7a1be1c commit ee7af2f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/default/DbaInferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function dataFileAsserts(): iterable
yield from $this->gatherAssertTypes(__DIR__.'/data/pdo-default-fetch-types.php');
yield from $this->gatherAssertTypes(__DIR__.'/data/bug372.php');
yield from $this->gatherAssertTypes(__DIR__.'/data/inference-placeholder.php');
yield from $this->gatherAssertTypes(__DIR__.'/data/bug394.php');
}

/**
Expand Down
21 changes: 21 additions & 0 deletions tests/default/data/bug394.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Bug394;

class X {
/**
* @var \Doctrine\DBAL\Connection
*/
private $conn;

public function bug394($sequence)
{
if ($sequence['conditionId'] !== null) {
$query = 'SELECT email, adaid FROM ada WHERE adaid = ?';
$fetchResult = $this->conn->fetchAssociative($query, [$sequence['conditionId']]);
assertType('array{email: string, adaid: int<-32768, 32767>}|false', $fetchResult);
}
}
}


0 comments on commit ee7af2f

Please sign in to comment.