Creates the hook
@method create
544807
function() {

    var hookPath = path.resolve(this.options.dest, this.hookName);

    var existingCode = this.getHookContent(hookPath);

    if (existingCode) {
      this.validateScriptLanguage(existingCode);
    }

    var hookContent;
    if(this.hasMarkers(existingCode)) {
      hookContent = this.insertBindingCode(existingCode);
    } else {
      hookContent = this.appendBindingCode(existingCode);
    }

    fs.writeFileSync(hookPath, hookContent);

    fs.chmodSync(hookPath, '755');
  }
1084066
public function make($name)
    {
        $studlyCase = studly_case($name);

        // Check if already exists
        if ($this->downloaded($name)) {
            throw new Exceptions\HookAlreadyExistsException("Hook [{$name}] already exists.");
        }

        event(new Events\MakingHook($name));

        // Ensure hooks folder exists
        if (!$this->filesystem->isDirectory(base_path('hooks'))) {
            $this->filesystem->makeDirectory(base_path('hooks'));
        }

        // Create folder for the new hook
        $this->filesystem->deleteDirectory(base_path("hooks/{$name}"));
        $this->filesystem->makeDirectory(base_path("hooks/{$name}"));

        // make stub files
        $this->makeStubFiles($name);

        event(new Events\MadeHook($name));
    }
716475
function _hook(slf, name, handlerInfo, params) {
  if (!slf.__hooks[name]) return;

  slf.__hooks[name].forEach(function (hook) {
    hook(handlerInfo, params);
  });
}
472454
private function createCommand() : Command\Hook
    {
        /* @var \CaptainHook\App\Console\Command\Hook $command */
        $class   = '\\CaptainHook\\App\\Console\\Command\\Hook\\' . Util::getHookCommand($this->hookToExecute);
        $command = new $class($this->getConfigFile(), $this->getRepositoryPath());
        $command->setHelperSet($this->getHelperSet());

        return $command;
    }
940566
def create(key, value, options = {})
      last = false
      @stack.each {|s| last = s.create(key, value, options) }
      last
    end
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;
  }
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
1020514
public static function make($hook, $channel = '', $message = null, $options = [])
    {
        return new static($hook, $channel, $message, $options);
    }
94700
function createHook(handler) {
    return function nodeDevHook(module, filename) {
      if (module.parent === wrapper) {
        // If the main module is required conceal the wrapper
        module.id = '.';
        module.parent = null;
        process.mainModule = module;
      }
      if (!module.loaded) callback(module.filename);

      // Invoke the original handler
      handler(module, filename);

      // Make sure the module did not hijack the handler
      updateHooks();
    };
  }
901602
public int create(Reference object, HookCreate create) {
		return getResourceFactory()
				.getApiResource(
						"/hook/" + object.getType() + "/" + object.getId()
								+ "/")
				.entity(create, MediaType.APPLICATION_JSON)
				.post(HookCreateResponse.class).getId();
	}
997701
def add_method_hooks
      eigen_class = @target.singleton_class

      if @options[:class_methods]
        return unless @target.is_a?(Module)

        orig_singleton_method_added = @target.method(:singleton_method_added)

        eigen_class.send :define_method, :singleton_method_added do |method|
          aspector_singleton_method_added(method)
          orig_singleton_method_added.call(method)
        end
      else
        if @target.is_a? Module
          orig_method_added = @target.method(:method_added)
        else
          orig_method_added = eigen_class.method(:method_added)
        end

        eigen_class.send :define_method, :method_added do |method|
          aspector_instance_method_added(method)
          orig_method_added.call(method)
        end
      end
    end
29824
public function hook($method, $callback = null)
    {
        if (is_array($method)) {
            $this->hook = array_merge($this->hook, $method);
        } else {
            $this->hook[$method] = $callback;
        }
    }
1268774
def call_hook(self, hook, *args, **kwargs):
        
        for function in self.hooks[hook]:
            function.__call__(*args, **kwargs)
997031
function create() {
  function app(stanza) { app.handle(stanza); }
  utils.merge(app, application);
  app._stack = [];
  app._filters = [];
  for (var i = 0; i < arguments.length; ++i) {
    app.use(arguments[i]);
  }
  return app;
}
655293
function executeHooks(data, allHooks, checkHooks, creationMode) {
    var hooksToCall = creationMode ? allHooks : checkHooks;
    if (hooksToCall) {
        callHooks(data, hooksToCall);
    }
}
1355340
def hook(name=None, *args, **kwargs):
    
    def decorator(f):
        if not hasattr(f, "hooks"):
            f.hooks = []
        f.hooks.append((name or f.__name__, args, kwargs))
        return f
    return decorator
1108404
public static function create()
	{
		switch (func_num_args()) {
			case 0:
				return new MethodOptions();
			case 1:
				return new MethodOptions(func_get_arg(0));
			case 2:
				return new MethodOptions(func_get_arg(0), func_get_arg(1));
			case 3:
				return new MethodOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2));
			case 4:
				return new MethodOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3));
			case 5:
				return new MethodOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4));
			case 6:
				return new MethodOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5));
			case 7:
				return new MethodOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6));
			case 8:
				return new MethodOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6), func_get_arg(7));
			default:
				throw new \InvalidArgumentException('More than 8 arguments supplied, please be reasonable.');
		}
	}