Remove event or its callable

@param  string $eventName
@param  callable|null $callable
@access protected
518983
protected function removeEventCallable(
        /*# string */ $eventName,
        $callable
    ) {
        if (null === $callable) {
            // remove all callables
            $this->events[$eventName]->flush();
        } else {
            // remove one callable
            $this->events[$eventName]->remove($callable);
        }

        // when count is zero, remove queue
        if (count($this->events[$eventName]) === 0) {
            unset($this->events[$eventName]);
        }
    }
1020584
def off(self, name, callback, once=False):
        

        if name not in self.event_listeners:
            return

        self.event_listeners[name].remove((callback, once))
334431
public function set($name, $callable)
    {
        $name = ltrim($name, '\\');
        $this->callables[$name] = $callable;
        unset($this->instances[$name]);
    }
932761
public function removeListener(
        string $event,
        callable $listener
    )
    {
        if ($this->_events[$event] ?? false) {

            $key = array_search(
                $listener,
                $this->_events[$event],
                true
            );

            if ($key !== false) {

                array_splice(
                    $this->_events[$event],
                    $key,
                    1
                );
            }
        }

        return $this;
    }
814337
public final function on( $eventName, $eventCallback ) {
			
			if ( !is_string( $eventName ) ) {
			
				throw new \browserfs\Exception('Invalid argument $eventName: string expected');
			
			} else {
			
				if ( !strlen( $eventName ) ) {
			
					throw new \browserfs\Exception('Invalid argument $eventName: expected non-empty string');
			
				} else {
			
					if ( !is_callable( $eventCallback ) ) {
			
						throw new \browserfs\Exception('Invalid argument $eventCallback: callable expected' );
			
					} else {

						$this->events[ $eventName ] = isset( $this->events[ $eventName ] ) 
							? $this->events[ $eventName ] 
							: [];

						$this->events[ $eventName ][] = [
							'once' => false,
							'callback' => $eventCallback,
							'fireId' => 0
						];

					}
				}
			}

		}
934757
public function removeHandler(callable $handler)
    {
        $key = array_search($handler, $this->eventHandlers, true);

        if ($key !== false) {
            unset($this->eventHandlers[$key]);
        }
    }
1028223
public function on(string $eventName, callable $callBack, int $priority = 100)
    {
        if (!isset($this->listeners[$eventName])) {
            $this->listeners[$eventName] = [
                true,  // If there's only one item, it's sorted
                [$priority],
                [$callBack]
            ];
        } else {
            $this->listeners[$eventName][0] = false; // marked as unsorted
            $this->listeners[$eventName][1][] = $priority;
            $this->listeners[$eventName][2][] = $callBack;
        }
    }
707453
public function removeHook($command, $callable)
    {
        if (isset($this->hooks[$command]) &&
            array_search($callable, $this->hooks[$command]) !== false
        ) {
            $hook = array_search($callable, $this->hooks[$command]);
            unset($this->hooks[$command][$hook]);
            unset($hook);
        }
    }
96997
function removeAllListeners(string $eventName = null) {

        if (!\is_null($eventName)) {
            unset($this->listeners[$eventName]);
            unset($this->listeners_flat[$eventName]);
        } else {
            $this->listeners = [];
            $this->listeners_flat = [];
        }

    }
754866
public function un($event, callable $fn = null) {
        if (isset($this->events[$event])) {
            if ($fn) {
                foreach ($this->events[$event] as $k => $ev) {
                    if ($ev === $fn) {
                        unset($this->events[$event][$k]);
                        break;
                    }
                }
            } else {
                unset($this->events[$event]);
            }
        }
        return $this;
    }
742810
public T remove() {
        EventImpl event = (EventImpl) CurrentEvent.get();
        if (null != event) {
            // Also need to remove name, if specified, from the Event's Set.
            if (name != null) {
                event.removeEventLocalName(name);
            }
            return event.remove(this);
        }
        return null;
    }
601024
public function removeListener($event, $callback)
    {
        if (false === isset($this->listeners[$event])) {

            return;
        }

        $key = array_search($callback, $this->listeners[$event]);
        if ($key !== false) {
            unset($this->listeners[$event][$key]);

            if (0 === count($this->listeners[$event])) {
                unset($this->listeners[$event]);
            }
        }
    }
731526
public function removeEvent($event, $table = null): void
    {
        unset($this->events[$table ?? static::TABLE_ANY][$event]);
    }
1129905
protected function callListener($callable, Event $event)
    {
        if ($callable instanceof Closure || is_array($callable)) {
            call_user_func_array($callable, array_filter([$event, $event->getSubject(), $event->getData()]));
        } elseif (is_object($callable)) {
            $callable->{$event->getType()}($event, $event->getSubject(), $event->getData());
        }
    }
1281412
function(eventName) {
      var t = this, socket = t.get('socket');
      if (t.socketEvents && t.socketEvents[eventName]) {
        socket.removeListener(eventName, t.socketEvents[eventName]);
        delete t.socketEvents[eventName];
      }
      return t;
    }
941851
public function dispatch($event/*, string $eventName = null*/)
    {
        if (null === $this->callStack) {
            $this->callStack = new \SplObjectStorage();
        }

        $currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : '';
        $eventName = 1 < \func_num_args() ? \func_get_arg(1) : null;

        if (\is_object($event)) {
            $eventName = $eventName ?? \get_class($event);
        } else {
            @trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead.', EventDispatcherInterface::class), E_USER_DEPRECATED);
            $swap = $event;
            $event = $eventName ?? new Event();
            $eventName = $swap;

            if (!$event instanceof Event) {
                throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an instance of %s, %s given.', EventDispatcherInterface::class, Event::class, \is_object($event) ? \get_class($event) : \gettype($event)));
            }
        }

        if (null !== $this->logger && ($event instanceof Event || $event instanceof ContractsEvent || $event instanceof StoppableEventInterface) && $event->isPropagationStopped()) {
            $this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
        }

        $this->preProcess($eventName);
        try {
            $this->beforeDispatch($eventName, $event);
            try {
                $e = $this->stopwatch->start($eventName, 'section');
                try {
                    $this->dispatcher->dispatch($event, $eventName);
                } finally {
                    if ($e->isStarted()) {
                        $e->stop();
                    }
                }
            } finally {
                $this->afterDispatch($eventName, $event);
            }
        } finally {
            $this->currentRequestHash = $currentRequestHash;
            $this->postProcess($eventName);
        }

        return $event;
    }
496195
public function removeListener($event_name, callable $listener)
    {
        // Read in our config/events file so that we have them all!
        if (! $this->have_read_from_file)
        {
            $this->readConfigFile();
        }

        if (! isset($this->listeners[$event_name]))
        {
            return false;
        }

        foreach ($this->listeners[$event_name][2] as $index => $check)
        {
            if ($check === $listener)
            {
                unset($this->listeners[$event_name][1][$index]);
                unset($this->listeners[$event_name][2][$index]);

                return true;
            }
        }

        return false;
    }