You are here

function HookSystem::drupalAlter in X Autoload 7.5

Parameters

string $hook:

mixed $data:

File

tests/src/VirtualDrupal/HookSystem.php, line 42

Class

HookSystem

Namespace

Drupal\xautoload\Tests\VirtualDrupal

Code

function drupalAlter($hook, &$data) {
  $args = func_get_args();
  assert($hook === array_shift($args));
  assert($data === array_shift($args));
  while (count($args) < 3) {
    $args[] = NULL;
  }
  foreach ($this
    ->moduleImplements($hook . '_alter') as $extension) {
    $function = $extension . '_' . $hook . '_alter';
    $function($data, $args[0], $args[1], $args[2]);
  }
}