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

Method parse_namespace

src/parser/mod.rs:1224–1228  ·  view source on GitHub ↗

Parse PHP source text and extract the declared namespace (if any). Returns the namespace string (e.g. `"Klarna\Rest\Checkout"`) or `None` if the file has no namespace declaration.

(&self, content: &str)

Source from the content-addressed store, hash-verified

1222 /// Returns the namespace string (e.g. `"Klarna\Rest\Checkout"`) or
1223 /// `None` if the file has no namespace declaration.
1224 pub(crate) fn parse_namespace(&self, content: &str) -> Option<String> {
1225 with_parsed_program(content, "parse_namespace", |program, _content| {
1226 Self::extract_namespace_from_statements(program.statements.iter())
1227 })
1228 }
1229}

Callers 2

find_or_load_functionMethod · 0.80

Calls 2

with_parsed_programFunction · 0.85
iterMethod · 0.80

Tested by

no test coverage detected