Draft: Reduce BC stubs to the minimum
3 open threads
Closes #3523385
Merge request reports
Activity
added 12 commits
-
3619f7ac...00080f5a - 7 commits from branch
project:11.1.x
- c3e2ec15 - Revert "Issue #3512835 by nicxvan: [11.1.x] Add BC stubs for Hook ordering"
- 9b2ef40f - Fix line breaks in param doc on Hook.
- e3cae7c8 - Add BC stubs for order classes.
- 003c6d53 - Add the order parameter in Hook::__construct(), as it was added in #3512835.
- ed5d643b - Fix typo in param doc.
Toggle commit list-
3619f7ac...00080f5a - 7 commits from branch
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) { Let's be clear, this variadic constructor demonstrates how far we can go if we really want the minimum necessary to achieve the objective.
This will survive any future parameter changes from later branches.There can be good reasons why we don't want to do this, and rather backport the arguments 1:1 from 11.2.x.
changed this line in version 3 of the diff
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. 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, added 1 commit
- 64f01d09 - Drop RelativeOrderBase, inline the constructor in each subclass.
Please register or sign in to reply