Skip to main content

MirDatabase

Trait MirDatabase 

Source
pub trait MirDatabase: Database {
Show 23 methods // 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>>; fn file_namespace(&self, file: &str) -> Option<Arc<str>>; fn file_imports(&self, file: &str) -> HashMap<String, String>; fn global_var_type(&self, name: &str) -> Option<Union>; fn file_import_snapshots(&self) -> Vec<(Arc<str>, HashMap<String, String>)>; fn symbol_defining_file(&self, symbol: &str) -> Option<Arc<str>>; fn symbols_defined_in_file(&self, file: &str) -> Vec<Arc<str>>; fn record_reference_location(&self, loc: RefLoc); fn replay_reference_locations( &self, file: Arc<str>, locs: &[(String, u32, u16, u16)], ); fn extract_file_reference_locations( &self, file: &str, ) -> Vec<(Arc<str>, u32, u16, u16)>; fn reference_locations( &self, symbol: &str, ) -> Vec<(Arc<str>, u32, u16, u16)>; fn has_reference(&self, symbol: &str) -> bool; fn clear_file_references(&self, file: &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.

Source

fn file_namespace(&self, file: &str) -> Option<Arc<str>>

Return this file’s first declared namespace, if any.

Source

fn file_imports(&self, file: &str) -> HashMap<String, String>

Return this file’s use alias map.

Source

fn global_var_type(&self, name: &str) -> Option<Union>

Return the known type for a PHP global variable.

Source

fn file_import_snapshots(&self) -> Vec<(Arc<str>, HashMap<String, String>)>

Return (file, imports) snapshots for every known file.

Source

fn symbol_defining_file(&self, symbol: &str) -> Option<Arc<str>>

Return the defining file for a symbol, if known.

Source

fn symbols_defined_in_file(&self, file: &str) -> Vec<Arc<str>>

Return all symbols whose defining file is file.

Source

fn record_reference_location(&self, loc: RefLoc)

Record a reference-location entry.

Source

fn replay_reference_locations( &self, file: Arc<str>, locs: &[(String, u32, u16, u16)], )

Replay reference locations for one file from cache.

Source

fn extract_file_reference_locations( &self, file: &str, ) -> Vec<(Arc<str>, u32, u16, u16)>

Extract reference locations for one file in cache-storage shape.

Source

fn reference_locations(&self, symbol: &str) -> Vec<(Arc<str>, u32, u16, u16)>

Return all reference locations for one public symbol key.

Source

fn has_reference(&self, symbol: &str) -> bool

Whether the public symbol key has at least one recorded reference.

Source

fn clear_file_references(&self, file: &str)

Clear reference locations for a file before re-analysis.

Implementors§