Retuns the scope defined for a specific hook.
@since 1.0.0

@param string $hook Wordpress hook.

@return string
776720
private function getHookScope($hook)
    {
        return isset($this->hooks[$hook]) && isset($this->hooks[$hook]['scope'])
            ? $this->hooks[$hook]['scope']
            : 'init';
    }
420536
protected function parseClassEvent($class, $hook)
    {
        if (str_contains($class, '@')) {
            return explode('@', $class);
        }

        // If no method is defined, use the hook name as the method name.
        $method = str_contains($hook, '-') ? str_replace('-', '_', $hook) : $hook;

        return [$class, $method];
    }
1204858
public function getHook($name = null)
    {
        if (empty($name)) {
            return $this->_hooks;
        } else {
            return isset($this->_hooks[$name]) ? $this->_hooks[$name] : [];
        }
    }
227761
protected function getHookList($scope, $hookName)
    {
        $key = $scope . '_' . $hookName;

        if (!isset($this->hookListHash[$key])) {
            $hookList = array();

            if (isset($this->data['Common'][$hookName])) {
                $hookList = $this->data['Common'][$hookName];
            }

            if (isset($this->data[$scope][$hookName])) {
                $hookList = array_merge($hookList, $this->data[$scope][$hookName]);
                usort($hookList, array($this, 'cmpHooks'));
            }

            $normalizedList = array();
            foreach ($hookList as $hookData) {
                $normalizedList[] = $hookData['className'];
            }

            $this->hookListHash[$key] = $normalizedList;
        }

        return $this->hookListHash[$key];
    }
826610
public static function hasHookFired($type = 'action', $hook = null)
    {
        if (! in_array($type, ['action', 'filter'], true)) {
            $type = 'action';
        }
        $target = $type === 'filter' ? 'filters' : 'actions';
        if (empty($hook) || ! is_string($hook)) {
            $msg = __METHOD__.' needs a valid hook to check.';
            throw new InvalidArgumentException($msg);
        }

        return array_key_exists($hook, static::$hooks_done[$target]);
    }
478456
public static function getSubscribers(string $hook)
    {
        if (!isset(self::$hooks[$hook]))
            return array();

        $subs = [];
        foreach (self::$hooks[$hook] as $h)
            $subs[] = $h['callback'];

        return $subs;
    }
1127614
protected function triggerHook($hook, $image)
    {
        if (is_callable($hook)) {
            $hook($image);
        }

        // We assume that the user is passing the hook class name
        if (is_string($hook)) {
            $instance = app($hook);
            $instance->handle($image);
        }
    }
323602
public function run($hook, $args = null)
    {
        if (is_array($args)) {
            return $this->applyFiltersRefArray($hook, $args);
        }

        return $this->applyFilters($hook, $args);
    }
7078
public static function getExecuteCount(string $hook)
    {
        return isset(self::$counters[$hook]) ? self::$counters[$hook] : 0;
    }
580002
function addHook(hooks, hook) {
    hooks.push(hook)
    return function () {
      var i = hooks.indexOf(hook)
      if (i >= 0) return hooks.splice(i, 1)
    }
  }
203552
public function &getScope($scope)
    {
        if ($scope == Smarty::SCOPE_PARENT && !empty($this->parent)) {
            return $this->parent->tpl_vars;
        } elseif ($scope == Smarty::SCOPE_ROOT && !empty($this->parent)) {
            $ptr = $this->parent;
            while (!empty($ptr->parent)) {
                $ptr = $ptr->parent;
            }

            return $ptr->tpl_vars;
        } elseif ($scope == Smarty::SCOPE_GLOBAL) {
            return Smarty::$global_tpl_vars;
        }
        $null = null;

        return $null;
    }
700073
public static function mount($hook, $params = [])
    {
        is_array($params) || $params = [$params];
        if (isset(self::$mountInfo[$hook])) {
            self::$mountInfo[$hook] += $params;
        } else {
            self::$mountInfo[$hook] = $params;
        }
    }
18559
final private function add_hooks($hooks)
    {
        foreach ($hooks as $tag => $filter) {
            if (\is_string($filter)) {
                $this->add_filter($tag, $filter);
            } else {
                foreach ($filter as $priority => $callbacks) {
                    if (\is_string($callbacks)) {
                        $this->add_filter($tag, $callbacks, $priority);
                    } else {
                        $count = \count($callbacks);

                        for ($i = 0; $i < $count; $i++) {
                            $this->add_filter($tag, $callbacks[ $i ], $priority);
                        }
                    }
                }
            }
        }
    }
429189
public function get_hooked_list( $tag = false, $echo = true ) {

		global $wp_filter;

		$output = '';

		if ( $tag ) {
			$hook[ $tag ] = $wp_filter[ $tag ]->callbacks;

			if ( ! is_array( $hook[ $tag ] ) ) {
				$hook[ $tag ] = array();
				trigger_error( "Nothing found for '$tag' hook", E_USER_WARNING );
				return;
			}
		} else {
			$hook = $wp_filter;
			ksort( $hook );
		}

		$output .= '<pre>';
		foreach ( $hook as $tag => $priorities ) {
			if ( ! is_array( $priorities ) ) {
				continue;
			}
			$output .= "\n&gt;&gt;&gt;&gt;&gt;\t<strong>$tag</strong>\n";
			ksort( $priorities );

			foreach ( $priorities as $priority => $functions ) {

				$output .= $priority;
				foreach ( $functions as $name => $properties ) {
					$output .= "\t$name";

					if ( is_array( $properties['function'] ) ) {

						if ( is_object( $properties['function'][0] ) ) {
							$output .= "\t\t" . get_class( $properties['function'][0] ) . " (Object)\n";
						}

					} elseif ( is_object( $properties['function'] ) && $properties['function'] instanceof \Closure ) {

						/**
						 * @link http://stackoverflow.com/questions/38241093/how-to-get-array-from-a-closure-object-in-php
						 */
						$reflection = new \ReflectionFunction( $properties['function'] );
						$reflection->getClosureScopeClass();

						$output .= "\t\t" . get_class( $reflection->getClosureThis() ) . " (Closure)\n";
					} else {
						$output .= "\t\t (Function)\n";
					}

					$output .= "\n";
				}
			}
		}
		$output .= '</pre>';

		if ( ! $echo ) {
			return $output;
		}

		echo $output;
	}
1076803
public function with($hook)
    {
        if (!in_array($hook, PluginInterface::VALID_HOOKS)) {
            throw new InvalidArgumentException("The `{$hook}` hook is not a known plugin hook.");
        }
        foreach ($this as $plugin) {
            if ($plugin->isEnabled($hook)) {
                yield $plugin;
            }
        }
    }
693813
public function setHook(string $hook) : Installer
    {
        if (!empty($hook) && !Util::isValid($hook)) {
            throw new Exception\InvalidHookName('Invalid hook name \'' . $hook . '\'');
        }
        $this->hookToHandle = $hook;
        return $this;
    }
1235717
function hook() {
      var comp = hook.proxy.apply(null, arguments);
      for(var i = 0;i < hooks.length;i++) {
        hooks[i].apply(comp, arguments);
      }
      return comp;
    }