original_string: protected function _attachSubscriber(EventListenerInterface $subscriber)
      {
          foreach ((array)$subscriber->implementedEvents() as $eventKey => $function) {
              $options = [];
              $method = $function;
              if (is_array($function) && isset($function['callable'])) {
                  list($method, $options) = $this->_extractCallable($function, $subscriber);
              } elseif (is_array($function) && is_numeric(key($function))) {
                  foreach ($function as $f) {
                      list($method, $options) = $this->_extractCallable($f, $subscriber);
                      $this->on($eventKey, $options, $method);
                  }
                  continue;
              }
              if (is_string($method)) {
                  $method = [$subscriber, $function];
              }
              $this->on($eventKey, $options, $method);
          }
      }
code: protected function _attachSubscriber(EventListenerInterface $subscriber)
      {
          foreach ((array)$subscriber->implementedEvents() as $eventKey => $function) {
              $options = [];
              $method = $function;
              if (is_array($function) && isset($function['callable'])) {
                  list($method, $options) = $this->_extractCallable($function, $subscriber);
              } elseif (is_array($function) && is_numeric(key($function))) {
                  foreach ($function as $f) {
                      list($method, $options) = $this->_extractCallable($f, $subscriber);
                      $this->on($eventKey, $options, $method);
                  }
                  continue;
              }
              if (is_string($method)) {
                  $method = [$subscriber, $function];
              }
              $this->on($eventKey, $options, $method);
          }
      }
code_tokens: protected function _attachSubscriber ( EventListenerInterface $ subscriber ) { foreach ( ( array ) $ subscriber -> implementedEvents ( ) as $ eventKey => $ function ) { $ options = [ ] ; $ method = $ function ; if ( is_array ( $ function ) && isset ( $ function [ 'callable' ] ) ) { list ( $ method , $ options ) = $ this -> _extractCallable ( $ function , $ subscriber ) ; } elseif ( is_array ( $ function ) && is_numeric ( key ( $ function ) ) ) { foreach ( $ function as $ f ) { list ( $ method , $ options ) = $ this -> _extractCallable ( $ f , $ subscriber ) ; $ this -> on ( $ eventKey , $ options , $ method ) ; } continue ; } if ( is_string ( $ method ) ) { $ method = [ $ subscriber , $ function ] ; } $ this -> on ( $ eventKey , $ options , $ method ) ; } }
docstring: Auxiliary function to attach all implemented callbacks of a Cake\Event\EventListenerInterface class instance
  as individual methods on this manager
  
  @param \Cake\Event\EventListenerInterface $subscriber Event listener.
  @return void
docstring_tokens: Auxiliary function to attach all implemented callbacks of a Cake \ Event \ EventListenerInterface class instance as individual methods on this manager