private function determinePath(array $server): string
    {
        $path = '';
        if (strpos($server['SCRIPT_NAME'], 'index.php') !== false) {
            $path = str_replace('index.php', '', $server['SCRIPT_NAME']);
        }

        $parts = explode('?', $server['REQUEST_URI']);

        $length = 0;
        if ($path !== '' && strpos($parts[0], $path) === 0) {
            $length = strlen($path);
        }

        return '/' . ltrim(substr($parts[0], $length), '/');
    }
private function determinePath(array $server): string
    {
        $path = '';
        if (strpos($server['SCRIPT_NAME'], 'index.php') !== false) {
            $path = str_replace('index.php', '', $server['SCRIPT_NAME']);
        }

        $parts = explode('?', $server['REQUEST_URI']);

        $length = 0;
        if ($path !== '' && strpos($parts[0], $path) === 0) {
            $length = strlen($path);
        }

        return '/' . ltrim(substr($parts[0], $length), '/');
    }
private function determinePath ( array $ server ) : string { $ path = '' ; if ( strpos ( $ server [ 'SCRIPT_NAME' ] , 'index.php' ) !== false ) { $ path = str_replace ( 'index.php' , '' , $ server [ 'SCRIPT_NAME' ] ) ; } $ parts = explode ( '?' , $ server [ 'REQUEST_URI' ] ) ; $ length = 0 ; if ( $ path !== '' && strpos ( $ parts [ 0 ] , $ path ) === 0 ) { $ length = strlen ( $ path ) ; } return '/' . ltrim ( substr ( $ parts [ 0 ] , $ length ) , '/' ) ; }
Determines the used path by using passed server configuration.

@param string[] $server
The server configuration.
@return string The determined path.
Determines the used path by using passed server configuration .