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

Function resolve_variable_subject

src/diagnostics/deprecated.rs:406–423  ·  view source on GitHub ↗

Resolve a subject expression to a `ClassInfo` using the full resolver pipeline ([`resolve_subject_outcome`]). This handles both simple `$variable` subjects and complex expressions like `$payment->getOrder()` or `$this->faker`. The resolver uses the diagnostic scope cache (when active) for variable lookups, avoiding backward-scanner fallthroughs.

(
    subject_text: &str,
    is_static: bool,
    rctx: &ResolutionCtx<'_>,
)

Source from the content-addressed store, hash-verified

404/// the diagnostic scope cache (when active) for variable lookups,
405/// avoiding backward-scanner fallthroughs.
406fn resolve_variable_subject(
407 subject_text: &str,
408 is_static: bool,
409 rctx: &ResolutionCtx<'_>,
410) -> Option<ClassInfo> {
411 let access_kind = if is_static {
412 AccessKind::DoubleColon
413 } else {
414 AccessKind::Arrow
415 };
416
417 match resolve_subject_outcome(subject_text.trim(), access_kind, rctx) {
418 SubjectOutcome::Resolved(classes) => {
419 classes.into_iter().next().map(|arc| ClassInfo::clone(&arc))
420 }
421 _ => None,
422 }
423}

Callers 1

Calls 4

resolve_subject_outcomeFunction · 0.85
nextMethod · 0.80
into_iterMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected