Skip to content
Snippets Groups Projects

Draft: Reduce BC stubs to the minimum

Closes #3523385

Merge request reports

Members who can merge are allowed to add commits.
Approval is optional
Code Quality is loading
Test summary results are being parsed
Merge blocked: 1 check failed
Merge request must not be draft.

Merge details

  • The source branch is 15 commits behind the target branch.
  • 1 commit will be added to 11.1.x.
  • Source branch will not be deleted.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
42 * {@inheritdoc}
17 * @param mixed ...$args
18 * In this version of Drupal, the constructor accepts any combination of
19 * named and indexed arguments.
43 20 */
44 public function getOperation(string $identifier): OrderOperation {
45 return new BeforeOrAfter(
46 $identifier,
47 $this->modules,
48 array_map(
49 static fn(array $class_and_method) => implode('::', $class_and_method),
50 $this->classesAndMethods,
51 ),
52 $this->isAfter(),
53 );
21 public function __construct(mixed ...$args) {
  • 124 108 * the implementation is in.
    125 109 * @param \Drupal\Core\Hook\Order\OrderInterface|null $order
    126 110 * (optional) Set the order of the implementation. This parameter is
    127 * supported in Drupal 11.2 and greater. It will have no affect in Drupal
    111 * supported in Drupal 11.2 and greater. It will have no effect in Drupal
    128 112 * 11.1.
    • We could also change this to:

      Suggested change
      112 * 11.1.
      112 * (optional) Set the order of the implementation.
      113 * In this version of Drupal, this parameter has no effect.
      114 * It was added only for forward compatibility with Drupal 11.2.x and later.
    • Please register or sign in to reply
  • 124 108 * the implementation is in.
    125 109 * @param \Drupal\Core\Hook\Order\OrderInterface|null $order
    126 110 * (optional) Set the order of the implementation. This parameter is
    127 * supported in Drupal 11.2 and greater. It will have no affect in Drupal
    111 * supported in Drupal 11.2 and greater. It will have no effect in Drupal
    128 112 * 11.1.
    129 113 */
    130 114 public function __construct(
    131 public string $hook = '',
    115 public string $hook,
    132 116 public string $method = '',
    133 117 public ?string $module = NULL,
    134 118 public OrderInterface|null $order = NULL,
    • We could omit the public here, so that the parameter is properly discarded.

      However, by doing this we also make this unusable for any 3rd party code that wants to read the value.
      This code would then have to provide its own version of the class, and make sure that has precedence in autoload.

    • Please register or sign in to reply
  • added 1 commit

    • 64f01d09 - Drop RelativeOrderBase, inline the constructor in each subclass.

    Compare with previous version

  • Please register or sign in to reply
    Loading