Skip to main content

MirDatabase

Trait MirDatabase 

Source
pub trait MirDatabase: Database {
    // Required methods
    fn php_version_str(&self) -> Arc<str> ;
    fn lookup_class_node(&self, fqcn: &str) -> Option<ClassNode>;
    fn lookup_function_node(&self, fqn: &str) -> Option<FunctionNode>;
    fn lookup_method_node(
        &self,
        fqcn: &str,
        method_name_lower: &str,
    ) -> Option<MethodNode>;
    fn lookup_property_node(
        &self,
        fqcn: &str,
        prop_name: &str,
    ) -> Option<PropertyNode>;
    fn lookup_class_constant_node(
        &self,
        fqcn: &str,
        const_name: &str,
    ) -> Option<ClassConstantNode>;
    fn lookup_global_constant_node(
        &self,
        fqn: &str,
    ) -> Option<GlobalConstantNode>;
    fn class_own_methods(&self, fqcn: &str) -> Vec<MethodNode>;
    fn class_own_properties(&self, fqcn: &str) -> Vec<PropertyNode>;
    fn active_class_node_fqcns(&self) -> Vec<Arc<str>>;
    fn active_function_node_fqns(&self) -> Vec<Arc<str>>;
}
Expand description

Salsa database trait for mir incremental analysis.

Required Methods§

Source

fn php_version_str(&self) -> Arc<str>

The PHP version configured for this analysis run.

Source

fn lookup_class_node(&self, fqcn: &str) -> Option<ClassNode>

Look up the ClassNode handle registered for fqcn, if any.

This is an untracked read — the DashMap holds Salsa input handles (cheap IDs), not data. Changes to a class’s fields (parent, interfaces, active state) are tracked through the ClassNode input itself, so downstream queries are still correctly invalidated.

Source

fn lookup_function_node(&self, fqn: &str) -> Option<FunctionNode>

Look up the FunctionNode handle registered for fqn, if any.

Source

fn lookup_method_node( &self, fqcn: &str, method_name_lower: &str, ) -> Option<MethodNode>

Look up the MethodNode for (fqcn, method_name_lower), if any.

method_name_lower must already be lowercased. This is an untracked read — changes to a method’s fields are tracked through the MethodNode input itself.

Source

fn lookup_property_node( &self, fqcn: &str, prop_name: &str, ) -> Option<PropertyNode>

Look up the PropertyNode for (fqcn, prop_name), if any.

Source

fn lookup_class_constant_node( &self, fqcn: &str, const_name: &str, ) -> Option<ClassConstantNode>

Look up the ClassConstantNode for (fqcn, const_name), if any.

Source

fn lookup_global_constant_node(&self, fqn: &str) -> Option<GlobalConstantNode>

Look up the GlobalConstantNode for fqn, if any.

Source

fn class_own_methods(&self, fqcn: &str) -> Vec<MethodNode>

Return all own-method nodes for fqcn. Empty if no class is registered. Untracked iteration of a per-class HashMap.

Source

fn class_own_properties(&self, fqcn: &str) -> Vec<PropertyNode>

Return all own-property nodes for fqcn. Empty if no class is registered. Untracked iteration of a per-class HashMap.

Source

fn active_class_node_fqcns(&self) -> Vec<Arc<str>>

Return all class-FQCNs currently registered as active ClassNodes, optionally filtered by kind. Untracked snapshot — callers should treat the returned Vec as a one-shot view.

Source

fn active_function_node_fqns(&self) -> Vec<Arc<str>>

Return all function-FQNs currently registered as active FunctionNodes. Untracked snapshot.

Implementors§