original_string: public function set($route = null)
      {
          if (!isset($route)) {
  
              $routes = $this->getList();
              $command = array_shift($this->params);
  
              if (isset($this->aliases[$command])) {
                  $command = $this->aliases[$command];
              }
  
              if (empty($routes[$command])) {
                  $command = 'help';
                  $this->params = array();
              }
  
              if (empty($routes[$command])) {
                  throw new OutOfBoundsException('Unknown command');
              }
  
              if (isset($routes[$command]['status']) && empty($routes[$command]['status'])) {
                  throw new OutOfBoundsException('Disabled command');
              }
  
              $route = $routes[$command];
              $route['command'] = $command;
              $route['params'] = $this->params;
          }
  
          $this->route = (array) $route;
          return $this;
      }
code: public function set($route = null)
      {
          if (!isset($route)) {
  
              $routes = $this->getList();
              $command = array_shift($this->params);
  
              if (isset($this->aliases[$command])) {
                  $command = $this->aliases[$command];
              }
  
              if (empty($routes[$command])) {
                  $command = 'help';
                  $this->params = array();
              }
  
              if (empty($routes[$command])) {
                  throw new OutOfBoundsException('Unknown command');
              }
  
              if (isset($routes[$command]['status']) && empty($routes[$command]['status'])) {
                  throw new OutOfBoundsException('Disabled command');
              }
  
              $route = $routes[$command];
              $route['command'] = $command;
              $route['params'] = $this->params;
          }
  
          $this->route = (array) $route;
          return $this;
      }
code_tokens: public function set ( $ route = null ) { if ( ! isset ( $ route ) ) { $ routes = $ this -> getList ( ) ; $ command = array_shift ( $ this -> params ) ; if ( isset ( $ this -> aliases [ $ command ] ) ) { $ command = $ this -> aliases [ $ command ] ; } if ( empty ( $ routes [ $ command ] ) ) { $ command = 'help' ; $ this -> params = array ( ) ; } if ( empty ( $ routes [ $ command ] ) ) { throw new OutOfBoundsException ( 'Unknown command' ) ; } if ( isset ( $ routes [ $ command ] [ 'status' ] ) && empty ( $ routes [ $ command ] [ 'status' ] ) ) { throw new OutOfBoundsException ( 'Disabled command' ) ; } $ route = $ routes [ $ command ] ; $ route [ 'command' ] = $ command ; $ route [ 'params' ] = $ this -> params ; } $ this -> route = ( array ) $ route ; return $ this ; }
docstring: Sets the current route
  @param array|null $route
  @return $this
  @throws OutOfBoundsException
docstring_tokens: Sets the current route