-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Bug: BaseBuilder's query is wrong #3659
Comments
Technically speaking it's not a bug since we still respect the contract in the In this case, I'm not really sure if we want to have all the parameters or are they missing by accident (probably?). However, the current implementation doesn't cause any malfunction. From what I see this "pattern" occurs also in other database related interfaces ( |
No Problem, phpStorm flags like that. I guess it is just a warning from phpStorm. |
Probably PhpStorm hasn't scanned all the classes correctly. From PHP.net on interfaces:
Basically it is okay for a class to build on an interface definition as long as it is not violating it. @michalsn I think that some of these parameters were added later and thus not included in the interface. Whether that was by mistake or for backwards-compatibility I can't say, but for now I think we leave the less-restrictive interface. At some point (version 5? haha) I would like to see the whole database namespace get overhauled to be a) more loosely interoperative and b) less specific to SQL... that would likely be the time to redefine our interfaces or, more likely, to differentiate them. |
Yes, I'm not keen to make changes to the interfaces at this point either. |
Newest CodeIgniter Developer version 4
BaseBuilder.php - The query method is being passed 3 parameters but the ConnectionInterface.php is only using 2 parameters.
Example:
system/Database/BaseBuilder.php
Line #1860
: $this->db->query($this->compileSelect(), $this->binds, false);
<-- 3 parameters are being passedsystem/Database/ConnectionInnterface.php
public function query(string $sql, $binds = null);
<-- Only 2 signature parameters are definedThis is affecting every query method in BaseBuilder.php
The text was updated successfully, but these errors were encountered: