Skip to content

Commit d1f036f

Browse files
committed
fix type error
1 parent 9800912 commit d1f036f

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/QueryReflection/PdoPgSqlQueryReflector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(PDO $pdo)
3030
/**
3131
* @return PDOException|array<PDOColumnMeta>|null
3232
*/
33-
protected function simulateQuery(string $queryString)
33+
protected function simulateQuery(string $queryString) // @phpstan-ignore method.childReturnType
3434
{
3535
if (\array_key_exists($queryString, $this->cache)) {
3636
return $this->cache[$queryString];

src/QueryReflection/ReflectionCache.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ private function readCachedRecords(bool $useReadLock): ?array
157157

158158
// the schemaHash is only available in replay-and-record mode.
159159
if (null === $this->schemaHash) {
160+
if (!is_string($cache['schemaHash'])) {
161+
throw new ShouldNotHappenException();
162+
}
160163
$this->schemaHash = $cache['schemaHash'];
161164
} elseif ($this->schemaHash !== $cache['schemaHash']) {
162165
return null;

tests/rules/QueryPlanAnalyzerRuleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
class QueryPlanAnalyzerRuleTest extends RuleTestCase
1818
{
1919
/**
20-
* @var bool|0|positive-int
20+
* @var bool
2121
*/
2222
private $numberOfAllowedUnindexedReads;
2323

0 commit comments

Comments
 (0)