original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: 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.
docstring_tokens: Removes a listener from the active listeners .