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

fetchOne returns always numeric-string instead of string|false #237

Closed
Seldaek opened this issue Feb 3, 2022 · 1 comment · Fixed by #242
Closed

fetchOne returns always numeric-string instead of string|false #237

Seldaek opened this issue Feb 3, 2022 · 1 comment · Fixed by #242
Labels
bug Something isn't working

Comments

@Seldaek
Copy link
Contributor

Seldaek commented Feb 3, 2022

            $defaultVersionId = $conn->fetchOne('SELECT id FROM package_version WHERE package_id = :id ORDER BY defaultBranch DESC, releasedAt DESC LIMIT 1', ['id' => $id]);
            \PHPStan\dumpType($defaultVersionId);

Dumped type: numeric-string

From https://github.com/composer/packagist/blob/main/src/Command/PopulateDependentsSuggestersCommand.php#L71

fetchOne returns false if there is no result though.

@staabm staabm added the bug Something isn't working label Feb 4, 2022
@Seldaek
Copy link
Contributor Author

Seldaek commented Feb 4, 2022

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants