hook_form_FORM_ID_alter hooks are not converted to OOP

Created on 13 October 2025, about 2 months ago

Drupal version

11.2.2

Drupal Rector version

0.21.0

Problem / Motivation

We are using rector to convert hooks. It works with most hooks but hook_form_FORM_ID_alter hooks are not converted.
For example:

/**
 * Implements hook_form_FORM_ID_alter().
 *
 * @phpstan-param mixed[] $form
 */
function foo_form_menu_link_edit_alter(&$form) : void {
 //
}
🐛 Bug report
Status

Active

Component

Code

Created by

🇫🇷France prudloff Lille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024