src/Traits/FixedEventTrait.php
public function off(string $event)
    {
        if (false === ($key = array_search($event, $this->getSupportedEvents(), true))) {
            return null;
        }

        if (!isset($this->eventHandlers[$key]) || !($cb = $this->eventHandlers[$key])) {
            return null;
        }

        $this->eventHandlers[$key] = null;

        return $cb;
    }
public function off(string $event)
    {
        if (false === ($key = array_search($event, $this->getSupportedEvents(), true))) {
            return null;
        }

        if (!isset($this->eventHandlers[$key]) || !($cb = $this->eventHandlers[$key])) {
            return null;
        }

        $this->eventHandlers[$key] = null;

        return $cb;
    }
public function off ( string $ event ) { if ( false === ( $ key = array_search ( $ event , $ this -> getSupportedEvents ( ) , true ) ) ) { return null ; } if ( ! isset ( $ this -> eventHandlers [ $ key ] ) || ! ( $ cb = $ this -> eventHandlers [ $ key ] ) ) { return null ; } $ this -> eventHandlers [ $ key ] = null ; return $ cb ; }
remove event handler
@param string $event
@return bool
remove event handler