Skip to content

Conversation

@staabm
Copy link
Owner

@staabm staabm commented Feb 19, 2022

refs #269

@staabm
Copy link
Owner Author

staabm commented Feb 19, 2022

@Seldaek could you double check this one matches your expectations? just verifying the test-expectations would be enough for now.

Comment on lines +47 to +48
$all = $stmt->fetchAll(PDO::FETCH_CLASS);
assertType('array<int, stdClass>', $all);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all good to me, but just to make sure, a simple fetch() here would return stdClass|false, right? Might be worth adding for completeness.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetch() without args depends on a previous setFetchMode(), which needs #258 and which in turn waits for the next phpstan release

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I see, great to see it all coming together :)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tricky part was figuring out how this stateful apis can work in phpstan context.

I don't know any extension which did this before, so this is kind of an achievement

@staabm staabm merged commit 29dddd0 into main Feb 19, 2022
@staabm staabm deleted the pdo-class branch February 19, 2022 09:10
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 this pull request may close these issues.

4 participants