-
-
Notifications
You must be signed in to change notification settings - Fork 699
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
Add a Doctrine DBAL 2.11 Rule Set #4517
Conversation
This is burried in the 2.11 deprecations.
Caught the common stuff.
Hi, thanks for your contribution 👍
I'll merge current PR as it is, so we can keep it simple. Feel free to open a new one with addition changes. Btw, I see there is dbal 4.0 released/planned? Do you think it would be useful to have upgrade set in Rector for 4.0 as well? |
@@ -18,7 +19,7 @@ | |||
->call('configure', [[ | |||
RenameMethodRector::METHOD_CALL_RENAMES => inline_value_objects([ | |||
new MethodCallRename( | |||
'DBAL\Platforms\AbstractPlatform', | |||
'Doctrine\DBAL\Platforms\AbstractPlatform', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Not a diff, but here's the relevant bit of the docs: the array keys changed from
Take $statement = $connection->executeQuery('SELECT ...');
- $rows = $statement->fetchAll(FetchMode::ASSOCIATIVE);
+ $rows = $statement->fetchAllAssociative();
I don't think 3.X is out yet, so they may just be planning deprecations/removals for 4.X |
Actually, something like this |
Thanks for sharing. I see, let's take it step by step. In Is that something you'd like to contribute? If so, here is how you create a new rule. I can guide you on the pull-request. |
rectorphp/rector-src@9217e0d [ChangesReporting] Reuse defined errors vairable on ConsoleOutputFormatter (#4517)
See /~https://github.com/doctrine/dbal/blob/master/UPGRADE.md#upgrade-to-211
Lots of changes in DBAL 2.11, but I don't think all of them can be handled by rector. I also fixed a few things in the 3.0 rule set.
Questions:
DriverManager::getConnection
's array. Are there pre-existing rectors that can handle something like that?DriverException
for instance)fetchAll
->fetchAllAssociative
rename -- upgrade guide mentions that quite a fewfetchAll*
methods were added, but the conneciton docblocks sayfetchAll
returns associative arrays. Statement docblocks are not clear, but PDO itself defaults to fetch both associative and numeric. Hard to say if this should be included.