<commit_before><?hh // decl

class Route {
  public static function dispatch(string $path, string $method): void {

    // Get the auto-generated URI Map
    $routes = require('build/URIMap.php');

    // Match the path
    foreach($routes as $route_path => $controller_name) {
      if(preg_match(
        "@$route_path@i",
        "$_SERVER[REQUEST_METHOD]$_SERVER[REQUEST_URI]",
        $_SESSION['route_params'])
      ) {
        echo var_dump($_SESSION['route_params']);
        echo $controller_name;
        die;
        $controller = new $controller_name();
        invariant($controller instanceof BaseController);

        Auth::verifyStatus($controller->getConfig()->getUserState());
        Auth::verifyRoles($controller->getConfig()->getUserRoles());

        $content = $controller::$method();
        if(is_object($content) && is_a($content, :xhp::class)) {
          Render::go($content, $controller_name);
        } elseif (is_object($content) && is_a($content, Map::class)) {
          print json_encode($content);
        }

        return;
      }
    }

    // No path was matched
    Render::go(FourOhFourController::get(), 'FourOhFourController');
  }

  public static function redirect(string $path): void {
    header('Location: ' . $path);
    exit();
  }
}<commit_msg>Fixed /signup being picked up by /<commit_after><?hh // decl

class Route {
  public static function dispatch(string $path, string $method): void {

    // Get the auto-generated URI Map
    $routes = require('build/URIMap.php');

    // Match the path
    foreach($routes as $route_path => $controller_name) {
      if(preg_match(
        "@^$route_path$@i",
        "$_SERVER[REQUEST_URI]",
        $_SESSION['route_params'])
      ) {
        $controller = new $controller_name();
        invariant($controller instanceof BaseController);

        Auth::verifyStatus($controller->getConfig()->getUserState());
        Auth::verifyRoles($controller->getConfig()->getUserRoles());

        $content = $controller::$method();
        if(is_object($content) && is_a($content, :xhp::class)) {
          Render::go($content, $controller_name);
        } elseif (is_object($content) && is_a($content, Map::class)) {
          print json_encode($content);
        }

        return;
      }
    }

    // No path was matched
    Render::go(FourOhFourController::get(), 'FourOhFourController');
  }

  public static function redirect(string $path): void {
    header('Location: ' . $path);
    exit();
  }
}
{'fraction_non_alphanumeric': 0.1553864637565078, 'fraction_numerical': 0.0, 'mean_word_length': 2.977707006369427, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7409508', 'n_tokens_mistral': 725, 'n_tokens_neox': 715, 'n_words': 145}