Issue #3602536 by marcelovani: Add native return types to RestUIForm
Builds on the bot's !11, which works on Drupal 12 as it stands — I tested it before changing anything and RestUITest passed. This only clears the three deprecations that were left behind, which are all the same thing:
Method "Drupal\Core\Form\FormInterface::getFormId()" might add "string" as a
native return type declaration in the future. Do the same in implementation
"Drupal\restui\Form\RestUIForm" now to avoid errors.Same for FormBase::create() and ConfigFormBase::getEditableConfigNames(). Adding a return type where the parent declares none is allowed on every version the module supports, so this is safe on 10.1 too.
Tested with run-tests.sh against a real browser, using the drupalci containers and the Chrome Driver image:
| Core | Result |
|---|---|
| 10.6.15 | 1 pass |
| 11.4.5 | 1 pass |
| 12.0-dev (PHP 8.5.8) | 1 pass, and the run is now free of deprecations |
phpcs --standard=Drupal,DrupalPractice is clean. Worth saying that the bot's own output here needed no reformatting, which was not true of every module it touched.
Two phpstan findings I left alone, both older than this branch and unrelated to Drupal 12: a dependency injection anti-pattern, and empty($plugin) at RestUIForm.php:132 where the variable always exists and is never falsy.