RectorをPHPStormでステップ実行
自作のRectorルールを実際の実行時にステップトレース実行する方法を紹介します。
rector.php
設定ファイルでdisableParallel()
でパラレル実行を無効にします。(デフォルト有効)
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/src',
]);
// register a single rule
$rectorConfig->rule(YourRectorRule::class);
// パラレル実行を停止
$rectorConfig->disableParallel();
PHPStormでステップトレース実行
Run > Edit Configurations... で--xdebug
オプションを指定します。