original_string: public function registerCallback($path, $callback)
      {
          //Ensure the path is a string
          if (!is_string($path)) {
              throw new Exception('Path must be a string');
          }
  
          //Ensure that the callback is callable
          if (!is_callable($callback)) {
              throw new Exception('Callback must be callable');
          }
  
          //All tags and paths are lower cased, for consistency
          $path = strtolower($path);
          if (substr($path, -1, 1) !== '/') {
              $path .= '/';
          }
  
          //If this is the first callback for this path, initialise the variable
          if (!isset($this->callbacks[$path])) {
              $this->callback[$path] = array();
          }
  
          //Add the callback
          $this->callbacks[$path][] = $callback;
  
          return $this;
      }
code: public function registerCallback($path, $callback)
      {
          //Ensure the path is a string
          if (!is_string($path)) {
              throw new Exception('Path must be a string');
          }
  
          //Ensure that the callback is callable
          if (!is_callable($callback)) {
              throw new Exception('Callback must be callable');
          }
  
          //All tags and paths are lower cased, for consistency
          $path = strtolower($path);
          if (substr($path, -1, 1) !== '/') {
              $path .= '/';
          }
  
          //If this is the first callback for this path, initialise the variable
          if (!isset($this->callbacks[$path])) {
              $this->callback[$path] = array();
          }
  
          //Add the callback
          $this->callbacks[$path][] = $callback;
  
          return $this;
      }
code_tokens: public function registerCallback ( $ path , $ callback ) { //Ensure the path is a string if ( ! is_string ( $ path ) ) { throw new Exception ( 'Path must be a string' ) ; } //Ensure that the callback is callable if ( ! is_callable ( $ callback ) ) { throw new Exception ( 'Callback must be callable' ) ; } //All tags and paths are lower cased, for consistency $ path = strtolower ( $ path ) ; if ( substr ( $ path , - 1 , 1 ) !== '/' ) { $ path .= '/' ; } //If this is the first callback for this path, initialise the variable if ( ! isset ( $ this -> callbacks [ $ path ] ) ) { $ this -> callback [ $ path ] = array ( ) ; } //Add the callback $ this -> callbacks [ $ path ] [ ] = $ callback ; return $ this ; }
docstring: Registers a single callback for a specified XML path
  
  @param string   $path     The path that the callback is for
  @param callable $callback The callback mechanism to use
  
  @return Parser
  @throws Exception
docstring_tokens: Registers a single callback for a specified XML path