def _hook_all
   _hooks.each do |type, hooks|
     hooks.each do |hook, data|
       data[:methods].each do |method|
         _hook_method(method)
       end
     end
   end
 end
177311
def _superclass_hooks
      hooks = { before: {}, after: {} }
      ancestors.reverse.each do |ancestor|
        next if ancestor == self
        hooks = hooks.deep_merge(ancestor.send(:_hooks)) if ancestor.respond_to?(:_hooks)
      end
      hooks
    end
1261488
function (hooks) {
        var obj = {};
        hooks.forEach(function (elements) {
            elements.forEach(function (item) {
                if (!obj[item.name]) {
                    obj[item.name] = item;
                }
            });
        });
        return obj;
    }
1180083
private function do_hook() {

		$args = func_get_args();
		if ( empty( $args ) ) {
			return false;
		}
		$name = array_shift( $args );

		return pods_do_hook( "api", $name, $args, $this );
	}
1230630
public function hooks()
    {
        $this->hook->action(
            'init',
            [$this->taxonomy, 'register']
        )->dispatch();

        $this->hook->action(
            "{$this->taxonomy->getModel()->getSlug()}_add_form_fields",
            [$this->taxonomy, 'fill']
        )->dispatch();

        $this->hook->action(
            "{$this->taxonomy->getModel()->getSlug()}_edit_form_fields",
            [$this->taxonomy, 'fill']
        )->dispatch();

        $this->hook->action(
            "created_{$this->taxonomy->getModel()->getSlug()}",
            [$this->taxonomy, 'save']
        )->dispatch();

        $this->hook->action(
            "edited_{$this->taxonomy->getModel()->getSlug()}",
            [$this->taxonomy, 'save']
        )->dispatch();
    }
1206530
protected function getHooks()
    {
        if (!self::$hooksHaveBeenRetrieved) {
            $hookClasses = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['phpunit']['FrameworkCleanUp'];
            if (is_array($hookClasses)) {
                foreach ($hookClasses as $hookClass) {
                    self::$hooks[] = GeneralUtility::getUserObj($hookClass);
                }
            }

            self::$hooksHaveBeenRetrieved = true;
        }

        return self::$hooks;
    }
1145124
protected function load_hooks() {
		add_action( 'init', [ $this, 'load' ] );
		add_action( 'init', [ $this, 'background_update' ] );
		add_action( 'init', [ $this, 'set_options_filter' ] );
		add_action( 'wp_ajax_github-updater-update', [ $this, 'ajax_update' ] );
		add_action( 'wp_ajax_nopriv_github-updater-update', [ $this, 'ajax_update' ] );

		// Load hook for shiny updates Basic Authentication headers.
		if ( self::is_doing_ajax() ) {
			$this->load_authentication_hooks();
		}

		add_filter( 'extra_theme_headers', [ $this, 'add_headers' ] );
		add_filter( 'extra_plugin_headers', [ $this, 'add_headers' ] );
		add_filter( 'upgrader_source_selection', [ $this, 'upgrader_source_selection' ], 10, 4 );

		// Needed for updating from update-core.php.
		if ( ! self::is_doing_ajax() ) {
			add_filter( 'upgrader_pre_download', [ $this, 'upgrader_pre_download' ], 10, 3 );
		}
	}
502542
def determine_hooks(self, controller=None):
        '''
        
        '''

        controller_hooks = []
        if controller:
            controller_hooks = _cfg(controller).get('hooks', [])
            if controller_hooks:
                return list(
                    sorted(
                        chain(controller_hooks, self.hooks),
                        key=operator.attrgetter('priority')
                    )
                )
        return self.hooks
921030
function Hook(hookName, taskNames, options) {

  /**
   * The name of the hook
   * @property hookName
   * @type {String}
   */
  this.hookName = hookName;

  /**
   * The name of the tasks that should be run by the hook, space separated
   * @property taskNames
   * @type {String}
   */
  this.taskNames = taskNames;

  /**
   * Options for the creation of the hook
   * @property options
   * @type {Object}
   */
  this.options = options || {};

  this.markerRegExp = new RegExp(this.options.startMarker.replace(/\//g, '\\/') +
                      '[\\s\\S]*' + // Not .* because it needs to match \n
                      this.options.endMarker.replace(/\//g, '\\/'), 'm');
}
210502
function(type, callbacks) {
        $.each(callbacks, function(i, callback) {
            this.addHook(type, callback);
        }.bind(this));
    }
653111
def hook(name, options={}, &block)
      hooks[name.to_s] << Hook.new(name.to_s, options, &block)
    end
218203
def run_hooks(self, packet):
        

        if packet.__class__ in self.internal_hooks:
            self.internal_hooks[packet.__class__](packet)

        if packet.__class__ in self.hooks:
            self.hooks[packet.__class__](packet)
607063
def get_hooks(self):
        
        headers, data = self.__requester.requestJsonAndCheck(
            "GET",
            "/hooks"
        )
        return [HookDescription.HookDescription(self.__requester, headers, attributes, completed=True) for attributes in data]
95968
function hooks(vNode, patch, index) {
    if (isVNode(vNode)) {
        if (vNode.hooks) {
            patch[index] = new VPatch(VPatch.PROPS, vNode.hooks, vNode.hooks)
        }

        if (vNode.descendantHooks) {
            var children = vNode.children
            var len = children.length
            for (var i = 0; i < len; i++) {
                var child = children[i]
                index += 1

                hooks(child, patch, index)

                if (isVNode(child) && child.count) {
                    index += child.count
                }
            }
        }
    }
}
389403
def add_hook(self, hook):
        
        h = hook.hash
        self.hooks[h] = hook
387756
def get_hooks(self):
    """"""
    if self.__hooks is None and self.hooks_class_name is not None:
      hooks_class = util.for_name(self.hooks_class_name)
      if not isinstance(hooks_class, type):
        raise ValueError("hooks_class_name must refer to a class, got %s" %
                         type(hooks_class).__name__)
      if not issubclass(hooks_class, hooks.Hooks):
        raise ValueError(
            "hooks_class_name must refer to a hooks.Hooks subclass")
      self.__hooks = hooks_class(self)

    return self.__hooks
1172391
def method_added(method_name)
      # do nothing if the method that was added was an actual hook method, or
      # if it already had hooks added to it
      return if hooks.include?(method_name) || hooked_methods.include?(method_name)
      add_hooks_to(method_name)
    end
316540
function addHook($type, $func, $prepend = false, $subtype = false)
    {
        if ($subtype)
        {
            if ($prepend)
            {
                array_unshift($this->hooks[$type][$subtype], $func);
            }
            else
            {
                $this->hooks[$type][$subtype][] = $func;
            }
        }
        else
        {
            if ($prepend)
            {
                array_unshift($this->hooks[$type], $func);
            }
            else
            {
                $this->hooks[$type][] = $func;
            }
        }
    }