Issue #3615507: Remove remaining static \Drupal:: calls from myrest.module

Moves the translatable_menu_link_uri logic into myrest.menu_link_override with its dependencies injected, leaving the hook as one line of delegation, and switches hook_help() to Url::fromRoute(). The three remaining static calls are in places with nothing to inject into and say so.

The move put the code under PHPStan for the first time, which found that the hook tested $item['original_link'] against the MenuLinkContent entity class while a menu tree carries the plugin, so the whole override body was unreachable. Fixing the import makes the overrides apply. link_override is also now guarded with hasField(), since reading it on a site without that module raised and logged for every link on every menu build.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

Closes #3615507

Merge request reports

Loading