original_string: protected function prepareRoutePattern($route): string
      {
          $pattern = str_replace('/', '\/', $route);
  
          foreach ($this->getParams() as $param => $type) {
              switch ($type) {
                  case 'int':
                  case 'integer':
                      $pattern = str_replace("{\$$param}", "(?P<$param>[0-9]+)", $pattern);
                      break;
                  case 'float':
                      $pattern = str_replace("{\$$param}", "(?P<$param>[0-9.,]+)", $pattern);
                      break;
                  case 'string':
                  case 'module':
                  case 'controller':
                      $pattern = str_replace(
                          "{\$$param}",
                          "(?P<$param>[a-zA-Z0-9-_.]+)",
                          $pattern
                      );
                      break;
              }
          }
          return '/^' . $pattern . '/i';
      }
code: protected function prepareRoutePattern($route): string
      {
          $pattern = str_replace('/', '\/', $route);
  
          foreach ($this->getParams() as $param => $type) {
              switch ($type) {
                  case 'int':
                  case 'integer':
                      $pattern = str_replace("{\$$param}", "(?P<$param>[0-9]+)", $pattern);
                      break;
                  case 'float':
                      $pattern = str_replace("{\$$param}", "(?P<$param>[0-9.,]+)", $pattern);
                      break;
                  case 'string':
                  case 'module':
                  case 'controller':
                      $pattern = str_replace(
                          "{\$$param}",
                          "(?P<$param>[a-zA-Z0-9-_.]+)",
                          $pattern
                      );
                      break;
              }
          }
          return '/^' . $pattern . '/i';
      }
code_tokens: protected function prepareRoutePattern ( $ route ) : string { $ pattern = str_replace ( '/' , '\/' , $ route ) ; foreach ( $ this -> getParams ( ) as $ param => $ type ) { switch ( $ type ) { case 'int' : case 'integer' : $ pattern = str_replace ( "{\$$param}" , "(?P<$param>[0-9]+)" , $ pattern ) ; break ; case 'float' : $ pattern = str_replace ( "{\$$param}" , "(?P<$param>[0-9.,]+)" , $ pattern ) ; break ; case 'string' : case 'module' : case 'controller' : $ pattern = str_replace ( "{\$$param}" , "(?P<$param>[a-zA-Z0-9-_.]+)" , $ pattern ) ; break ; } } return '/^' . $ pattern . '/i' ; }
docstring: Prepare Route pattern
  
  @param  string $route
  
  @return string
docstring_tokens: Prepare Route pattern