[After D10.1 EOL] Remove workaround closure

Created on 17 July 2023, over 1 year ago
Updated 2 July 2024, 9 months ago

Problem/Motivation

Now that Set MenuLinkContent getEntity to public visibility Fixed is merged in Drupal 11.x (10.2.x). When Drupal 10.1 will no more be supported, some workaround code could be removed.

Proposed resolution

In https://git.drupalcode.org/project/menu_per_role/-/blob/8.x-1.x/src/Menu..., remove:

      // Sadly ::getEntity() is protected at the moment.
      $function = function () {
        // @phpstan-ignore-next-line
        return $this->getEntity();
      };
      $function = \Closure::bind($function, $instance, \get_class($instance));
      /** @var \Drupal\menu_link_content\Entity\MenuLinkContent $entity */
      $entity = $function();

use ->getEntity() directly.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France Grimreaper France 🇫🇷

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024