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

Introduce query value object to wrap sql queries #919

Merged
merged 5 commits into from
Jan 20, 2020

Conversation

goetas
Copy link
Member

@goetas goetas commented Jan 18, 2020

Q A
Type improvement
BC Break -
Fixed issues -

Summary

I think that the Query value object was a great idea proposed by @pulzarraider in #906. Independently if #906 is going to be merged, I see value in the Query part, so here is a full refactoring of the code base to use it everywhere instead of the current 3 different arrays holding the same data.

@goetas goetas added this to the 3.0.0 milestone Jan 18, 2020
@goetas goetas force-pushed the query-value-object branch 3 times, most recently from 5c795fe to 5ee2b89 Compare January 18, 2020 04:46
lib/Doctrine/Migrations/Query/Query.php Show resolved Hide resolved
* @param mixed[] $types
*/
public function __construct(string $statement, array $parameters = [], array $types = [])
{
Copy link
Member

Choose a reason for hiding this comment

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

What should happen if the number of parameters and the number of types is not the same?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Will check what is doing doctrine DBAL, and do something similar

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@goetas goetas merged commit dcd1d05 into doctrine:master Jan 20, 2020
@goetas goetas deleted the query-value-object branch January 20, 2020 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants