original_string: public function on($type, $callback)
      {
          if (!isset($this->callbacks[$type])) {
              $this->callbacks[$type] = [];
          }
          $this->callbacks[$type][] = $callback;
          return $this;
      }
code: public function on($type, $callback)
      {
          if (!isset($this->callbacks[$type])) {
              $this->callbacks[$type] = [];
          }
          $this->callbacks[$type][] = $callback;
          return $this;
      }
code_tokens: public function on ( $ type , $ callback ) { if ( ! isset ( $ this -> callbacks [ $ type ] ) ) { $ this -> callbacks [ $ type ] = [ ] ; } $ this -> callbacks [ $ type ] [ ] = $ callback ; return $ this ; }
docstring: Register event handler
  
  @param string $type
  @param \Closure|array|string $callback
  @return $this
docstring_tokens: Register event handler