public function detach($callable, $eventKey = null)
    {
        deprecationWarning('EventManager::detach() is deprecated. Use EventManager::off() instead.');
        if ($eventKey === null) {
            $this->off($callable);

            return;
        }
        $this->off($eventKey, $callable);
    }
public function detach($callable, $eventKey = null)
    {
        deprecationWarning('EventManager::detach() is deprecated. Use EventManager::off() instead.');
        if ($eventKey === null) {
            $this->off($callable);

            return;
        }
        $this->off($eventKey, $callable);
    }
public function detach ( $ callable , $ eventKey = null ) { deprecationWarning ( 'EventManager::detach() is deprecated. Use EventManager::off() instead.' ) ; if ( $ eventKey === null ) { $ this -> off ( $ callable ) ; return ; } $ this -> off ( $ eventKey , $ callable ) ; }
Removes a listener from the active listeners.

@param callable|\Cake\Event\EventListenerInterface $callable any valid PHP callback type or an instance of EventListenerInterface
@param string|null $eventKey The event unique identifier name with which the callback has been associated
@return void
@deprecated 3.0.0 Use off() instead.
Removes a listener from the active listeners .