Configurable
ReplacePdoFetchConstantsRector
Replace PDO::FETCH_* constants with FetchAs enum cases in Drupal Database API calls
-$statement->setFetchMode(\PDO::FETCH_ASSOC);
+$statement->setFetchMode(\Drupal\Core\Database\Statement\FetchAs::Associative);
Configure your rector.php:
<?php
use DrupalRector\Drupal11\Rector\Deprecation\ReplacePdoFetchConstantsRector;
use DrupalRector\Rector\ValueObject\DrupalIntroducedVersionConfiguration;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withConfiguredRule(ReplacePdoFetchConstantsRector::class, [
new DrupalIntroducedVersionConfiguration('11.2.0'),
]);