Skip to content

Commit fc0205b

Browse files
Etienne V. Labellestaabm
authored andcommitted
Split ConstantIntegerType/ConstantStringType branches to satisfy ConstantArrayType constructor type
1 parent 420a2b1 commit fc0205b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/Extensions/PdoStatementExecuteTypeSpecifyingExtension.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,11 @@ private function inferStatementType(MethodReflection $methodReflection, MethodCa
8484
if (\count($bindArgs) >= 2) {
8585
$keyType = $scope->getType($bindArgs[0]->value);
8686
$constantStrings = $keyType->getConstantStrings();
87-
if ($keyType instanceof ConstantIntegerType || [] !== $constantStrings) {
88-
$parameterKeys[] = [] !== $constantStrings ? $constantStrings[0] : $keyType;
87+
if ($keyType instanceof ConstantIntegerType) {
88+
$parameterKeys[] = $keyType;
89+
$parameterValues[] = $scope->getType($bindArgs[1]->value);
90+
} elseif ([] !== $constantStrings) {
91+
$parameterKeys[] = $constantStrings[0];
8992
$parameterValues[] = $scope->getType($bindArgs[1]->value);
9093
}
9194
}

0 commit comments

Comments
 (0)