something(); } } CODE_SAMPLE // code after change , <<<'CODE_SAMPLE' somethingElse(); } } CODE_SAMPLE ); // [OPTIONAL - UNCOMMENT TO USE] // links to useful websites, that explain why the change is needed // $rectorRecipe->setResources([ // 'https://github.com/symfony/symfony/blob/704c648ba53be38ef2b0105c97c6497744fef8d8/UPGRADE-6.0.md' // ]); // do you need to check for extra generated file? // $rectorRecipe->addExtraFile('SomeExtraFile.php', 'addConfiguration(['SOME_CONSTANT_KEY' => ['before' => 'after']]); // [RECTOR CORE CONTRIBUTION] // [RECTOR CORE CONTRIBUTION - REQUIRED] // package name, basically part namespace in `rule//src`, use PascalCase // $rectorRecipe->setPackage('Generic'); // [RECTOR CORE CONTRIBUTION - OPTIONAL] // set the rule belongs to; is optional, because e.g. generic rules don't need a specific set to belong to // $rectorRecipe->setSet(\Rector\Set\ValueObject\SetList::NAMING); $services = $containerConfigurator->services(); $services->set(RectorRecipeProvider::class) ->arg('$rectorRecipe', inline_single_object($rectorRecipe, $services)); };