src/Events.php
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;
    }
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;
    }
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 ; }
Removes a single listener from an event.

If the listener couldn't be found, returns FALSE, else TRUE if
it was removed.

@param $event_name
@param callable $listener
@return bool
Removes a single listener from an event .