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.
This is an attempt to modernize the mysqli driver in Joomla. I am not sure if I am doing this the right way. I was not able to execute PHPCS and I see absolutely zero static analysis setup in this project. I run Psalm with level 4 and it returned a bunch of errors, which I fixed in the mysqli directory, but I didn't touch the rest.
This PR contains a few fixes I found through static analysis and manual reading through the code. It also contains simplifications to the existing code, which still contained workarounds for PHP < 5.6 despite composer claiming that the minimum version is PHP 7.2. I switched over to exception mode as I noticed that the PDO driver uses exceptions, so I see no reason why mysqli shouldn't. I removed reference binding, which I believe isn't needed anymore, but I wasn't able to test it properly as I have absolute no idea how to bind parameters in this project. There's a
setQuery()
method andexecute()
but there's no method to bind? The tests are also very limited and I doubt they test edge cases or even the happy path. I got no errors when I run PHPUnit on my machine.This is my first contact with anything Joomla related. I installed Joomla today, but I wasn't able to yet figure out how this DBAL is utilized by Joomla or by its plugins. I appreciate feedback on this PR. I did a similar review in Doctrine DBAL some time ago, and I wonder why Joomla isn't using Doctrine DBAL.