original_string: public function set($route, array $arguments = array())
      {
          if (!is_array($route)) {
  
              $pattern = $route;
              $list = $this->getList();
  
              if (empty($list[$pattern])) {
                  throw new OutOfBoundsException("Unknown route pattern $pattern");
              }
  
              $route = $list[$pattern];
              $route += array('arguments' => array(), 'pattern' => $pattern);
              $route['simple_pattern'] = preg_replace('@\(.*?\)@', '*', $pattern);
  
              if (!empty($arguments)) {
                  $route['arguments'] = array_merge($arguments, $route['arguments']);
              }
          }
  
          return $this->route = $route;
      }
code: public function set($route, array $arguments = array())
      {
          if (!is_array($route)) {
  
              $pattern = $route;
              $list = $this->getList();
  
              if (empty($list[$pattern])) {
                  throw new OutOfBoundsException("Unknown route pattern $pattern");
              }
  
              $route = $list[$pattern];
              $route += array('arguments' => array(), 'pattern' => $pattern);
              $route['simple_pattern'] = preg_replace('@\(.*?\)@', '*', $pattern);
  
              if (!empty($arguments)) {
                  $route['arguments'] = array_merge($arguments, $route['arguments']);
              }
          }
  
          return $this->route = $route;
      }
code_tokens: public function set ( $ route , array $ arguments = array ( ) ) { if ( ! is_array ( $ route ) ) { $ pattern = $ route ; $ list = $ this -> getList ( ) ; if ( empty ( $ list [ $ pattern ] ) ) { throw new OutOfBoundsException ( "Unknown route pattern $pattern" ) ; } $ route = $ list [ $ pattern ] ; $ route += array ( 'arguments' => array ( ) , 'pattern' => $ pattern ) ; $ route [ 'simple_pattern' ] = preg_replace ( '@\(.*?\)@' , '*' , $ pattern ) ; if ( ! empty ( $ arguments ) ) { $ route [ 'arguments' ] = array_merge ( $ arguments , $ route [ 'arguments' ] ) ; } } return $ this -> route = $ route ; }
docstring: Sets a route
  @param array|string $route
  @param array $arguments
  @return array
  @throws OutOfBoundsException
docstring_tokens: Sets a route