function OrderOperation::unpack

Converts the stored operation to objects that can apply ordering rules.

Parameters

array $packed_operation: Packed operation.

Return value

self Unpacked operation.

1 call to OrderOperation::unpack()
ModuleHandler::getHookOrderingRules in core/lib/Drupal/Core/Extension/ModuleHandler.php
Gets ordering rules for a hook.

File

core/lib/Drupal/Core/Hook/OrderOperation/OrderOperation.php, line 49

Class

OrderOperation
Base class for order operations.

Namespace

Drupal\Core\Hook\OrderOperation

Code

public static final function unpack(array $packed_operation) : self {
    [
        $is_before_or_after,
        $args,
    ] = $packed_operation;
    $class = $is_before_or_after ? BeforeOrAfter::class : FirstOrLast::class;
    return new $class(...$args);
}

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