删除一个监听器
@param $listener
@return $this
976575
public function remove($listener): self
    {
        if ($this->has($listener)) {
            $this->store->detach($listener);
            $this->store->rewind();

            $queue = new \SplPriorityQueue();

            foreach ($this->store as $otherListener) {
                // 优先级信息 @see self::add(). It like `[priority, counter value]`
                $priority = $this->store->getInfo();
                $queue->insert($otherListener, $priority);
            }

            $this->queue = $queue;
        }

        return $this;
    }
1248271
public function removeEventListener($event, $listener){
     if (!$this->events[$event]) return $this;
   

    $indexOf = 0;
    foreach ($this->Iterator('Array') as $EventListener) {
       if($EventListener === $listener)	{
         array_splice($this->events[$event], $indexOf, 1);	   	
         $indexOf--;
	   }
         $indexOf++;
    }
    return $this; 	
  }
443111
public function prepare($listener)
    {
        if (! $this->requirements->check()) {
            return $listener->preparationNotCompleted();
        }

        $this->installer->migrate();

        return $listener->preparationCompleted();
    }
363598
public function removeListener($event, $listener)
    {
        if (! $this->hasListener($event)) {
            return;
        }

        $event = $this->getEventName($event);
        $listeners = $this->listeners[$event];

        foreach ($listeners as $priority => $registed) {
            $listeners[$priority] = array_filter($registed, function ($reg) use ($listener) {
                return ! $reg->isListener($listener);
            });
        }

        $this->listeners[$event] = $listeners;

        unset($this->sortedListeners[$event], $listeners, $event);
    }
107912
public function register($event, callable $listener, $priority = null)
    {
        foreach ((array) $event as $e) {
            $this->registerListener($e, $listener, $priority);
        }

        return $this;
    }
314101
public function addListener($listener, $type = null)
    {
        if (!$type) {
            $type = basename(substr($listener, strrpos($listener, '\\') + 1), 'Listener');
            $type = lcfirst(rtrim($type, '0123456789'));
        }

        $this->_listeners[$type][$listener] = 1;

        return $this;
    }
1290191
public function removeListener( $eventName, IListener $listener )
    {
        if ( !isset( $this->listeners[ $eventName ] ) )
        {
            return $this;
        }

        foreach ( $this->listeners[ $eventName ] as $priority => $listeners )
        {
            if ( FALSE !== ( $key = array_search( $listener, $listeners, TRUE ) ) )
            {
                unset( $this->listeners[ $eventName ][ $priority ][ $key ], $this->_sorted[ $eventName ] );
            }
        }

        return $this;
    }
1342966
public function listen( Listener $listener ) {

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

		$this->listeners[ $listener->get_tag() ] = $listener;

		return true;
	}
840707
public function initialize(Listener $listener)
    {
        $this->listener = $listener;
        $this->topDirs = array_merge($this->topDirs,$listener->getPaths());
        $this->tracker->initialize($listener);
    }
1108104
public function on($event, callable $listener)
    {
        if (is_object($event) || strpos($event, '\\')) { // looks like a class
            throw new UnsupportedParameterException('Only string based events are supported');
        }

        if (!isset($this->listeners[$event])) {
            $this->listeners[$event] = [];
        }
        $this->listeners[$event][] = $listener;

        return $this;
    }
481784
public function initialize(Listener $listener)
    {
        $this->tracker->initialize($listener);
        $this->wathedPaths = $listener->getPaths();
    }
897217
static private function getListener($listener)
    {
        $listenerClassName = Ioc::resolveClassName($listener);
    	if (!isset(self::$_elInstances[$listenerClassName])) {
    		if (!($listener instanceof EventListenerInterface)) {
    			$listener = Ioc::createObject($listener);
    		}
    		self::$_elInstances[$listenerClassName] = $listener;
    	}
    	
    	return self::$_elInstances[$listenerClassName];
    }
658393
function (listener, prepend) {
			if ('function' === typeof listener)
			{
				var self = this,
					g = function (e)
					{
						e.lastListeners--;
						self.removeListener(g);
						listener.apply(listener, arguments);
					};
				g.listener = listener;
				
				this.addListener(g,prepend)
			}
			return this;
		}
867087
public function use_hook_listener( HookListenerInterface $listener ) {

		add_action(
			HookListenersRegistry::ACTION_REGISTER,
			function ( HookListenersRegistry $registry ) use ( $listener ) {

				$registry->register_listener( $listener );
			}
		);

		return $this;
	}
1003046
public function removeListener( $event, EventListener $listener = null ) {

		$event = strtolower( $event );

		if ( !$this->hasEvent( $event ) ) {
			return;
		}

		if ( $listener !== null ) {
			foreach ( $this->dispatchableListeners[$event] as $key => $dispatchableListener ) {
				if ( $dispatchableListener == $listener ) {
					unset( $this->dispatchableListeners[$event][$key] );
				}
			}
		}

		if ( $listener === null || $this->dispatchableListeners[$event] === array() ) {
			unset( $this->dispatchableListeners[$event] );
		}
	}
1220242
public function resolving($abstract, $listener)
    {
        $this->laravel->resolving($abstract, $this->buildResolvingCallable($listener));

        return $this->storeResolvingListener($abstract, $listener);
    }
867559
public function edit(Listener $listener)
    {
        $eloquent = Auth::user();
        $form = $this->presenter->password($eloquent);

        return $listener->showPasswordChanger(['eloquent' => $eloquent, 'form' => $form]);
    }