Skip to content

[dbal 4.0] Add deprecated PDO class to enum like #411

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

Merged
merged 1 commit into from
May 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions config/sets/doctrine-dbal-40.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
new MethodCallRename('Doctrine\DBAL\QueryCacheProfile', 'setResultCacheDriver', 'setResultCache'),
new MethodCallRename('Doctrine\DBAL\QueryCacheProfile', 'getResultCacheDriver', 'getResultCache'),
]);

$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
// @see https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-renamed-sqlite-platform-classes
'Doctrine\DBAL\Platforms\SqlitePlatform' => 'Doctrine\DBAL\Platforms\SQLitePlatform',
Expand Down Expand Up @@ -62,6 +63,14 @@
]
);

$rectorConfig->ruleWithConfiguration(RenameClassConstFetchRector::class, [
// @see https://github.com/doctrine/dbal/pull/5554
new RenameClassAndConstFetch('PDO', 'PARAM_INT', 'Doctrine\DBAL\ParameterType', 'INTEGER'),
new RenameClassAndConstFetch('PDO', 'PARAM_BOOL', 'Doctrine\DBAL\ParameterType', 'BOOLEAN'),
new RenameClassAndConstFetch('PDO', 'PARAM_STR', 'Doctrine\DBAL\ParameterType', 'STRING'),
new RenameClassAndConstFetch('PDO', 'PARAM_NULL', 'Doctrine\DBAL\ParameterType', 'NULL'),
]);

$rectorConfig->ruleWithConfiguration(
RenameMethodRector::class,
[
Expand Down
3 changes: 2 additions & 1 deletion rules/Dbal42/Rector/New_/AddArrayResultColumnNamesRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ public function refactor(Node $node): ?New_
return null;
}

$itemsExpr = $node->getArgs()[0]->value;
$itemsExpr = $node->getArgs()[0]
->value;

// pass column names as 1st argument
$arrayDimFetch = new ArrayDimFetch($itemsExpr, new LNumber(0));
Expand Down