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

Missing method in ExpressionBuilderInterface? #730

Open
samdark opened this issue Jul 26, 2023 · 3 comments
Open

Missing method in ExpressionBuilderInterface? #730

samdark opened this issue Jul 26, 2023 · 3 comments
Labels
status:ready for adoption Feel free to implement this issue.
Milestone

Comments

@samdark
Copy link
Member

samdark commented Jul 26, 2023

There was a build() method defined in Yii2 in ExpressionBuilderInterface. We have the interface empty now in yiisoft/db.

@samdark
Copy link
Member Author

samdark commented Jul 26, 2023

Could be done for more explicit type hinting like

public function build(InConditionInterface $expression, array &$params = []): string

@samdark
Copy link
Member Author

samdark commented Jul 26, 2023

Two ways solving that:

  1. Always use concrete builder and expression. Ditch the interface (is it isn't used with instanceof).
  2. Add method to the interface. Always type hint with ExpressionInterface, do instanceof check and throw an exception if argument isn't compatible.

@samdark
Copy link
Member Author

samdark commented Jul 27, 2023

Discussed internally w/ @terabytesoftw, @vjik, @darkdef. Decided to go way 2 i.e. add missing method to the interface and use ExpressionInterface everywhere.

@samdark samdark added the status:ready for adoption Feel free to implement this issue. label Jul 27, 2023
@Tigrov Tigrov added this to the 2.0.0 milestone Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue.
Projects
None yet
Development

No branches or pull requests

2 participants