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

Fix return type issue in prepareVisitEventsStatement #41

Closed
wants to merge 2 commits into from

Conversation

pawelabrams
Copy link

DBAL\Connection::executeQuery has a return type of ResultStatement in doctrine/dbal ^2.8.
Statement is a child class of ResultStatement in doctrine/dbal ^2.4.

Forward compatibility layer of doctrine/dbal 2.13 changes return type of DBAL\Connection::executeQuery to ResultStatement&BaseResult which specifically removes execute method from the result statement.
The method already executes the statement, so it is not needed explicitly in visitEvents.

DBAL\Connection::executeQuery has a return type of ResultStatement in ^2.8.
Statement is a child class of ResultStatement in doctrine/dbal ^2.4.
Forward compatibility layer of doctrine/dbal 2.13 changes return type of DBAL\Connection::executeQuery to ResultStatement&BaseResult which specifically removes execute method from the result statement. The method already executes the statement.
@othillo
Copy link
Member

othillo commented Apr 13, 2021

Thank you @pawelabrams! I am hopeful this will be fixed by doctrine/dbal#4596.

@pawelabrams
Copy link
Author

Even after the Doctrine fix (which I also hope they will figure out), this proposal seems to fix the underlying typing issue.

Are there any cases where the second ->execute is needed in line 297? If so, we can avoid the phpstan type issue by wrapping it in if ($statement instanceof Statement).

@pawelabrams pawelabrams changed the title Fix conflict with doctrine/dbal ^2.13 Fix return type issue in prepareVisitEventsStatement Apr 13, 2021
@stale
Copy link

stale bot commented May 15, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 15, 2021
@stale stale bot closed this May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants