original_string: public function on(string $event, $callback)
      {
          if (! is_string($callback) && ! is_callable($callback)) {
              throw new InvalidArgumentException(
                  'Invalid websocket callback. Must be a string or callable.'
              );
          }
  
          $this->callbacks[$event] = $callback;
  
          return $this;
      }
code: public function on(string $event, $callback)
      {
          if (! is_string($callback) && ! is_callable($callback)) {
              throw new InvalidArgumentException(
                  'Invalid websocket callback. Must be a string or callable.'
              );
          }
  
          $this->callbacks[$event] = $callback;
  
          return $this;
      }
code_tokens: public function on ( string $ event , $ callback ) { if ( ! is_string ( $ callback ) && ! is_callable ( $ callback ) ) { throw new InvalidArgumentException ( 'Invalid websocket callback. Must be a string or callable.' ) ; } $ this -> callbacks [ $ event ] = $ callback ; return $ this ; }
docstring: Register an event name with a closure binding.
  
  @param string
  @param callback
  
  @return $this
docstring_tokens: Register an event name with a closure binding .