function HookOrder::first

Set a hook implementation to be first.

Parameters

\Drupal\Core\DependencyInjection\ContainerBuilder $container: The container builder.

string $hook: The name of the hook.

string $class_and_method: Class and method separated by :: containing the hook implementation.

Return value

void

3 calls to HookOrder::first()
HookOrderEqualPriorityTest::testFirst in core/tests/Drupal/Tests/Core/Hook/HookOrderEqualPriorityTest.php
@covers ::first
HookOrderTest::testFirst in core/tests/Drupal/Tests/Core/Hook/HookOrderTest.php
@covers ::first
HookOrderTest::testFirstNoChange in core/tests/Drupal/Tests/Core/Hook/HookOrderTest.php
@covers ::first

File

core/lib/Drupal/Core/Hook/HookOrder.php, line 26

Class

HookOrder
Helper methods to set priorities of hook implementations.

Namespace

Drupal\Core\Hook

Code

public static function first(ContainerBuilder $container, string $hook, string $class_and_method) : void {
    self::changePriority($container, $hook, $class_and_method, TRUE);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.