original_string: public static function compareSlashes($routePattern, $path)
      {
          $patternSeparator = count(explode('/', $routePattern));
          if (preg_match('/\/$/', $routePattern)) {
              $patternSeparator--;
          }
          $routePattern = preg_replace('/\/\{.*\}$/', '', $routePattern);
          $cleanPatternSeparator = count(explode('/', $routePattern));
          if (preg_match('/\/$/', $routePattern)) {
              $cleanPatternSeparator--;
          }
          $path_sep = count(explode('/', $path));
          if (preg_match('/\/$/', $path)) {
              $path_sep--;
          }
          return abs($patternSeparator - $path_sep) < 1 || abs($cleanPatternSeparator - $path_sep) < 1;
      }
code: public static function compareSlashes($routePattern, $path)
      {
          $patternSeparator = count(explode('/', $routePattern));
          if (preg_match('/\/$/', $routePattern)) {
              $patternSeparator--;
          }
          $routePattern = preg_replace('/\/\{.*\}$/', '', $routePattern);
          $cleanPatternSeparator = count(explode('/', $routePattern));
          if (preg_match('/\/$/', $routePattern)) {
              $cleanPatternSeparator--;
          }
          $path_sep = count(explode('/', $path));
          if (preg_match('/\/$/', $path)) {
              $path_sep--;
          }
          return abs($patternSeparator - $path_sep) < 1 || abs($cleanPatternSeparator - $path_sep) < 1;
      }
code_tokens: public static function compareSlashes ( $ routePattern , $ path ) { $ patternSeparator = count ( explode ( '/' , $ routePattern ) ) ; if ( preg_match ( '/\/$/' , $ routePattern ) ) { $ patternSeparator -- ; } $ routePattern = preg_replace ( '/\/\{.*\}$/' , '' , $ routePattern ) ; $ cleanPatternSeparator = count ( explode ( '/' , $ routePattern ) ) ; if ( preg_match ( '/\/$/' , $ routePattern ) ) { $ cleanPatternSeparator -- ; } $ path_sep = count ( explode ( '/' , $ path ) ) ; if ( preg_match ( '/\/$/' , $ path ) ) { $ path_sep -- ; } return abs ( $ patternSeparator - $ path_sep ) < 1 || abs ( $ cleanPatternSeparator - $ path_sep ) < 1 ; }
docstring: Function that checks if the long of the patterns match
  @param $routePattern
  @param $path
  @return bool
docstring_tokens: Function that checks if the long of the patterns match