original_string: 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), '/');
      }
code: 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), '/');
      }
code_tokens: 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 ) , '/' ) ; }
docstring: Determines the used path by using passed server configuration.
  
  @param string[] $server
  The server configuration.
  @return string The determined path.
docstring_tokens: Determines the used path by using passed server configuration .