MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / normalise_path

Function normalise_path

src/composer.rs:375–382  ·  view source on GitHub ↗

Normalise a directory path: ensure it uses forward slashes and ends with `/`.

(path: &str)

Source from the content-addressed store, hash-verified

373
374/// Normalise a directory path: ensure it uses forward slashes and ends with `/`.
375pub fn normalise_path(path: &str) -> String {
376 let p = path.replace('\\', "/");
377 if p.ends_with('/') || p.is_empty() {
378 p
379 } else {
380 format!("{}/", p)
381 }
382}
383
384/// Resolve a fully-qualified PHP class name to a file path using PSR-4 mappings.
385///

Callers 3

collect_psr4_entriesFunction · 0.85
init_monorepoMethod · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by 1