You are here

class PureFunctions in X Autoload 7.5

Hierarchy

Expanded class hierarchy of PureFunctions

2 files declare their use of PureFunctions
AbstractExampleModules.php in tests/src/Example/AbstractExampleModules.php
MockDrupalSystem.php in tests/src/Mock/MockDrupalSystem.php

File

tests/src/VirtualDrupal/PureFunctions.php, line 7

Namespace

Drupal\xautoload\Tests\VirtualDrupal
View source
class PureFunctions {

  /**
   * @see module_invoke()
   *
   * @param string $module
   * @param string $hook
   *
   * @return mixed|null
   *
   * @todo Do this in a injectable object instead?
   * @see HookSystem::moduleInvoke()
   */
  static function moduleInvoke($module, $hook) {
    $args = func_get_args();
    assert($module === array_shift($args));
    assert($hook === array_shift($args));
    $function = $module . '_' . $hook;
    if (function_exists($function)) {
      return call_user_func_array($function, $args);
    }
    return NULL;
  }

  /**
   * @see bootstrap_hooks()
   *
   * @return string[]
   */
  static function bootstrapHooks() {
    return array(
      'boot',
      'exit',
      'watchdog',
      'language_init',
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PureFunctions::bootstrapHooks static function
PureFunctions::moduleInvoke static function @todo Do this in a injectable object instead?