Skip to content

Commit 984ad6c

Browse files
committed
fix
1 parent bf5adc2 commit 984ad6c

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

.phpstan-dba-mysqli.cache

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/QueryReflection/QueryReflection.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,20 @@ public function resolveParameters(Type $parameterTypes): ?array
473473
return $this->resolveConstantArray($arrays[0]);
474474
}
475475

476+
if ($parameterTypes->isArray()->yes()) {
477+
$valueType = $parameterTypes->getIterableValueType();
478+
479+
if ($valueType->isScalar()->yes()) {
480+
return [new Parameter(
481+
null,
482+
$valueType,
483+
QuerySimulation::simulateParamValueType($valueType, true),
484+
false
485+
)];
486+
}
487+
}
488+
489+
476490
return null;
477491
}
478492

tests/rules/config/.phpunit-phpstan-dba-mysqli.cache

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/rules/data/bug-749.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@ public function getMoreIds(string $s, array $ids): array
3939
->fetchFirstColumn();
4040
}
4141

42+
/**
43+
* @param array<int> $ids
44+
*/
45+
public function getArrayIds(string $s, array $ids): array
46+
{
47+
return $this
48+
->connection
49+
->executeQuery(
50+
'SELECT akid FROM ak WHERE akid IN ('. self::inPlaceholders($ids) .')',
51+
$ids,
52+
)
53+
->fetchFirstColumn();
54+
}
55+
4256
/**
4357
* Returns a string containing all required "?"-placeholders to pass $ids into a IN()-expression.
4458
*

0 commit comments

Comments
 (0)