Router/RouteCompiler.php
private static function determineStaticPrefix(Route $route, array $tokens): string
    {
        if (!$tokens) {
            return '';
        }

        if ('text' !== $tokens[0][0]) {
            return ($route->hasDefault($tokens[0][3]) || '/' === $tokens[0][1]) ? '' : $tokens[0][1];
        }

        $prefix = $tokens[0][1];

        if (isset($tokens[1][1]) && '/' !== $tokens[1][1] && false === $route->hasDefault($tokens[1][3])) {
            $prefix .= $tokens[1][1];
        }

        return $prefix;
    }
private static function determineStaticPrefix(Route $route, array $tokens): string
    {
        if (!$tokens) {
            return '';
        }

        if ('text' !== $tokens[0][0]) {
            return ($route->hasDefault($tokens[0][3]) || '/' === $tokens[0][1]) ? '' : $tokens[0][1];
        }

        $prefix = $tokens[0][1];

        if (isset($tokens[1][1]) && '/' !== $tokens[1][1] && false === $route->hasDefault($tokens[1][3])) {
            $prefix .= $tokens[1][1];
        }

        return $prefix;
    }
private static function determineStaticPrefix ( Route $ route , array $ tokens ) : string { if ( ! $ tokens ) { return '' ; } if ( 'text' !== $ tokens [ 0 ] [ 0 ] ) { return ( $ route -> hasDefault ( $ tokens [ 0 ] [ 3 ] ) || '/' === $ tokens [ 0 ] [ 1 ] ) ? '' : $ tokens [ 0 ] [ 1 ] ; } $ prefix = $ tokens [ 0 ] [ 1 ] ; if ( isset ( $ tokens [ 1 ] [ 1 ] ) && '/' !== $ tokens [ 1 ] [ 1 ] && false === $ route -> hasDefault ( $ tokens [ 1 ] [ 3 ] ) ) { $ prefix .= $ tokens [ 1 ] [ 1 ] ; } return $ prefix ; }
Determines the longest static prefix possible for a route.
Determines the longest static prefix possible for a route .