batyrmastyr / yii-db-rector-rules
Package info
github.com/batyrmastyr/yii-db-rector-rules
pkg:composer/batyrmastyr/yii-db-rector-rules
0.0.5
2026-01-11 17:15 UTC
Requires
- php: ^8.0
- rector/rector: ^2.3
Requires (Dev)
- phpunit/phpunit: ^10.5 || ^11.5 || ^12.5
README
Several Rector rules to upgrade yiisoft/db package from 1.3 to 2.0, mostly for tests.
Install
composer require --dev batyrmastyr/yii-db-rector-rules
How to use
Add rule set to rector.php like below
return RectorConfig::configure() ->withSets([YiisoftDbUpgradeSet::Yii3DbV2]) ;
What's inside
- Replace
(new Dsn(arguments))->asString()withnew Dsn(...) - Remove
InvalidArgumentException - Replace
->getSchema->getRawTableName()with->getQuoter()->getRawTableName() - Replace
SchemaInterface::TYPE_*constants withColumnType::* - Replace
Yiisoft\Db\Constraint\IndexConstraintwithYiisoft\Db\Constraint\Indexand change method calls to property access, e.g.$index->getColumnNames()[0]->$index->columnNames[0]