Detach an already attached event handler.

@param string $name
Name of event.
@param callable $callback
Function to detach from event.
@return bool True if handler found and removed, false otherwise.
169347
public function detachHandler($name, callable $callback)
    {
        if (! isset($this->events[$name])) {
            return false;
        }
        $index = array_search($callback, $this->events[$name], true);
        if ($index === false) {
            return false;
        }
        unset($this->events[$name][$index]);
        return true;
    }
649324
public function detach($event, $callback)
    {
        if (null !== $callback) {
            $oid = $this->hashCallable($callback);
            if (isset($this->callable_map[$event][$oid])) {
                $callback = $this->callable_map[$event][$oid];
                unset($this->callable_map[$event][$oid]);
            }
        } else {
            unset($this->callable_map[$event]);
        }
        return parent::detach($event, $callback);
    }
1248341
public static function make($name, Closure $callback = null)
    {
        $menu = new self($name);
        if ( ! is_null($callback)) {
            call_user_func($callback, $menu);
        }

        return $menu;
    }
940022
public function bind(string $name, callable $callback): self
    {
        $this->data->bind($name, $callback);
        return $this;
    }
494860
public function deleteQueue($name, array $options = [], callable $callback = null)
    {
        $ifUnused = array_key_exists('ifUnused', $options) ? (bool)$options['ifUnused'] : null;
        $ifEmpty = array_key_exists('ifEmpty', $options) ? (bool)$options['ifEmpty'] : null;
        $noWait = array_key_exists('noWait', $options) ? (bool)$options['noWait'] : null;

        $outputFrame = Queue\QueueDeleteFrame::create($name, $ifUnused, $ifEmpty, $noWait);
        $outputFrame->frameChannelId = $this->id;
        $this->connection->command($outputFrame);

        if (is_callable($callback)) {
            $this->on(self::EVENT_ON_CHANNEL_DELETE_QUEUE_CALLBACK, $callback);
        }
    }
909999
public function removeAction( $action, $callback )
    {
        $i = 0;

        foreach( $this->actions as $key => $value )
        {
            if ( $action === $key )
            {
                foreach( $value as $a => $call )
                {
                    if ( get_class( $callback[ 0 ] ) === get_class( $call[ 'callback' ][ 0 ] ) )
                    {
                        if ( $callback[ 1 ] === $call[ 'callback' ][ 1 ] )
                        {
                            unset( $this->actions[ $key ][ $i ] );

                            if ( $this->debug )
                            {
                                echo PHP_EOL . '-ACTION: ' . $action . ' -> '
                                        . $this->_serializeCallback( $callback )
                                        . ' + Priority: ' . $call[ 'priority' ]
                                        . PHP_EOL;
                            }

                            return TRUE;
                        }
                    }
                }
            }

            $i++;
        }

        return FALSE;
    }
439843
public function remove($name)
    {
        if (isset($this->{$name}))
        {
            unset($this->object[$name]);

            return true;
        }

        return false;
    }
1035040
public function detach($eventName, callable $handler)
    {
        if (isset($this->events[$eventName])) {
            $this->events[$eventName]->remove($handler);
            if (0 == count($this->events[$eventName])) {
                unset($this->events[$eventName]);
            }
        }
    }
283812
public static function deleteListener(String $eventName, $callback = NULL) : Bool
    {
        return Listener::delete($eventName, $callback);
    }
1227711
public function condition($name, callable $callback)
    {
        $this->conditions[$name] = $callback;

        // If
        $this->directive($name, function($expr) use ($name) {
            return $expr ? '<?php if ($__parser->check(\'' . $name . '\', $expr)): ?>'
                : '<?php if ($__parser->check(\'' . $name . '\')): ?>';
        });

        // elseif
        $this->directive('else' . $name, function($expr) use ($name) {
            return $expr ? '<?php elseif ($__parser->check(\'' . $name . '\', $expr)): ?>'
                : '<?php elseif ($__parser->check(\'' . $name . '\')): ?>';
        });

        // end
        $this->directive('end' . $name, function() {
            return '<?php endif; ?>';
        });
    }
1142576
public function run($name, $callback) {
        if (!is_callable($callback)) {
            throw new \InvalidArgumentException('$callback is not callable');
        }

        // Because, we need to remove exists Instance before fork
        $this->Storage->setup();

        $pid = pcntl_fork();
        if ($pid === -1) {
            return false;
        }
        if ($pid) {
            // main fork
            $this->pids[$name] = $pid;
            return true;
        } else {
            $result = call_user_func($callback);
            $this->Storage->set($this->getKey(), $name, $result);
            exit(0);
        }
    }
483334
public function filter($name, $callback)
	{
		$this->events->listen('router.filter: '.$name, $this->parseFilter($callback));
	}
55934
public function off($name)
    {
        if (isset($this->handlers[$name])) {
            unset($this->handlers[$name]);
        }
        return $this;
    }
475367
public static function script($name, $callback) 
    {
        if (phpQueryPlugin_Scripts::$scriptMethods[$name]) {
            throw new Exception("Script name conflict - '$name'");
        }
        phpQueryPlugin_Scripts::$scriptMethods[$name] = $callback;
    }
550883
public function detach( $name, $id )
    {
        if ( !isset( $this->listeners[$name][$id] ) )
        {
            return false;
        }

        unset( $this->listeners[$name][$id] );
        return true;
    }
1190673
public function hasEventHandler($name)
    {
        $name = strtolower($name);
        return isset($this->_events[$name]) && count($this->_events[$name]) > 0;
    }
820292
public function remove($name)
    {
        if(array_key_exists($name, $this->data))
        {
            unset($this->data[$name]);
            return true;
        }
        else
        {
            return false;
        }
    }