Dispach hook.

@return bool
343038
public function dispatch()
    {
        return $this->execute($this->getActionAlias('dispatch'), [
            $this->getSlug(),
            $this->getCallback(),
            $this->getArgument('piority'),
            $this->getArgument('numberOfArguments'),
        ]);
    }
900914
def remove_hook(self, key_name, hook_name):
        """"""
        kf = self.dct[key_name]
        if 'hooks' in kf:
            if hook_name in kf['hooks']:
                return kf['hooks'].pop(hook_name)
679250
public function dispatch($hook, $parameters = array()) {
		if (empty($this->hooks[$hook])) {
			return false;
		}

		foreach ($this->hooks[$hook] as $priority => $hooked) {
			foreach ($hooked as $callback) {
				call_user_func_array($callback, $parameters);
			}
		}

		return true;
	}
1052550
public function detach()
	{
		$pointer = null;
		
		if(is_resource($this->pointer))
			$pointer = $this->pointer;
		
		# apparently... this will kill the stream! why?? who knows.
		# what a silly spec.
		$this->pointer = null;
		
		return $pointer;
	}
664376
public function removeAttachments()
    {
        if (func_num_args() > 0) {
            $indices = is_array(func_get_arg(0)) ? func_get_arg(0) : func_get_args();

            foreach ($indices as $index) {
                unset($this->attachments[$index]);
            }

            $this->attachments = array_values($this->attachments);
        } else {
            $this->attachments = [];
        }

        return $this;
    }
499555
public function detach()
    {
        $this->calendar->getEvents()->removeEvent($this);
        $this->calendar = null;

        return $this;
    }
200090
public function addHook(Hook $hook)
  {
    # Attempt to find it first
    $exists = $this->getHook($hook->getName());

    # If it exists, return with null
    if (!\is_null($exists)) {
      return false;
    }

    # Add it to the list
    $this->hooks[$hook];

    return $this;
  }
852575
public function disable(): self
    {
        if (!empty($this->logs)) {
            $this->logs->removeListener($this);
        }

        return $this;
    }
354621
protected function _detachListeners()
    {
        $EventManager = EventManager::instance();
        foreach ($this->_listeners as $listener) {
            $EventManager->detach($listener);
        }
    }
638565
public function purge() {
        if ($this->isready) {
            $files = glob($this->glob_keys_pattern(), GLOB_MARK | GLOB_NOSORT);
            if (is_array($files)) {
                foreach ($files as $filename) {
                    @unlink($filename);
                }
            }
            $this->keys = array();
        }
        return true;
    }
194311
public function uncork()
    {
        $this->_corked = false;

        while ($call = array_shift($this->_queue)) {
            call_user_func_array(array($this,'trigger'), $call);
        }

        return $this;
    }
974114
public function unlink()
    {
        if($path = $this->getPath())
        {
            if(@unlink($path) === true)
            {
                if($this->getResource()) {
                    $this->close();
                }

                $this->_path = null;
                return true;
            }
        }
        else throw new BadMethodCallException('The stream "'.self::getName().'" does not support unlink.');

        return false;
    }
277363
public function unsetHook()
    {
        if ($this->hook_reference !== null)
        {
            Hook::unsubscribe(Hook::SHUTDOWN_HOOK, $this->hook_reference);
        }
    }
1076479
protected function unregisterModule($moduleName, $hook)
    {
        if (!in_array($hook, array_keys($this->modules))) {
            return false;
        }
        if (array_key_exists($moduleName, $this->modules[$hook])) {
            unset($this->modules[$hook][$moduleName]);
            return true;
        }
        return false;
    }
927143
public function detach()
    {
        $output       = $this->stream;
        $this->stream = null;
        $this->meta   = [];

        return $output;
    }
898180
public function hasDoing($hookName = null) : bool
    {
        if (null === $hookName) {
            return ! empty($this->current);
        }

        $hookName = $this->sanitizeKeyName($hookName);
        return $hookName && isset($this->current[$hookName]);
    }
163321
protected function runHook($hook, $dir)
    {
        $code = $this->shellHelper->executeSimple(
            implode("\n", (array) $hook),
            $dir
        );
        if ($code !== 0) {
            $this->output->writeln("<comment>The hook failed with the exit code: $code</comment>");
            return false;
        }

        return true;
    }