Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positives when using PDOStatement::fetch() with named arguments #10236

Closed
cgocast opened this issue Sep 28, 2023 · 1 comment · Fixed by #10237
Closed

False positives when using PDOStatement::fetch() with named arguments #10236

cgocast opened this issue Sep 28, 2023 · 1 comment · Fixed by #10237

Comments

@cgocast
Copy link
Contributor

cgocast commented Sep 28, 2023

This code snippet https://psalm.dev/r/b753871a4c should not raise a MixedReturnStatement and a MixedInferredReturnType

I'll write a PR to fix the issue

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/b753871a4c
<?php

function stmt_fetch_bound(PDOStatement $stmt, int $offset) : bool {
    return $stmt->fetch(cursorOffset: $offset, mode: PDO::FETCH_BOUND);
}
Psalm output (using commit 1f979f4):

INFO: MixedReturnStatement - 4:12 - Could not infer a return type

INFO: MixedInferredReturnType - 3:62 - Could not verify return type 'bool' for stmt_fetch_bound

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant