Refactor MySQLi statement to make it unaware of the connection #4894
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses some issues I saw while working on the
Statementclass of the MySQLi driver. The class itself is final, has no ancestors and its constructor is flagged as@internal. Under these circumstances, I assume that none of my changes count as a BC break.All protected properties have been made
privatebecauseprotectedvisibility in afinalclass is pretty much useless. Moreover, I've removed their_prefix according to our CS rules. I realize that both changes have been applied to the 4.0.x branch already, but I see no reason not to deliver them with 3.2.0 already. That should also ease future merges from 3.x to 4.x.The constructor requires a
mysqli_stmtinstance now. This way, the statement becomes fully unaware of the connection which is also consistent with the design of the corresponding class of the PDO driver.