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;
    }
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;
    }
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 ; }
Function that checks if the long of the patterns match
@param $routePattern
@param $path
@return bool
Function that checks if the long of the patterns match