Skip to main content

Crate mir_analyzer

Crate mir_analyzer 

Source

Re-exports§

pub use batch::analyze_source;
pub use batch::dead_code_issue_kinds;
pub use batch::discover_files;
pub use batch::AnalysisResult;
pub use batch::BatchOptions;
pub use file_analyzer::BatchFileAnalyzer;
pub use file_analyzer::FileAnalysis;
pub use file_analyzer::FileAnalyzer;
pub use file_analyzer::ParsedFile;
pub use indexing::IndexBatchOutcome;
pub use indexing::IndexCancel;
pub use indexing::IndexParallelism;
pub use php_version::ParsePhpVersionError;
pub use php_version::PhpVersion;
pub use session::AnalysisSession;
pub use source_provider::FsSourceProvider;
pub use source_provider::SourceProvider;
pub use symbol::DeclarationKind;
pub use symbol::DocumentSymbol;
pub use symbol::ReferenceKind;
pub use symbol::ResolvedSymbol;
pub use composer::ComposerError;
pub use composer::Psr4Map;

Modules§

batch
Batch-oriented project analysis on AnalysisSession.
composer
file_analyzer
Per-file analysis entry point for incremental analysis.
indexing
Chunked, cancellable workspace-indexing primitives.
php_version
Target PHP language version.
prelude
Convenience re-exports for common mir-analyzer use cases.
session
Session-based analysis API for incremental, per-file analysis.
source_provider
Abstraction over how the analyzer obtains file source text it doesn’t yet have in its in-memory salsa inputs.
suppression
Inline issue suppression via source comments.
symbol
Per-expression resolved symbol data, retained from body analysis.

Structs§

ChainedClassResolver
crate::ClassResolver composing a primary resolver (user’s PSR-4 / classmap) with a fallback (typically StubClassResolver). The primary is consulted first; if it misses, the fallback is tried.
DependencyGraph
File dependency graph: tracks which files depend on which other files. Used for incremental invalidation in LSP servers and build systems.
DocblockParser
FnParam
HoverInfo
Hover information for a symbol at a source location. Includes the inferred type, optional docstring, and location of definition.
Issue
ParsedDocblock
Position
A position in source code: 1-based line, 0-based codepoint column.
Range
A range in source code: start and end positions.
StubClassResolver
crate::ClassResolver that maps PHP built-in class FQCNs (ArrayObject, Exception, ReflectionClass, …) to the stub virtual path that defines them. Used by crate::ChainedClassResolver to make find_class_like aware of PHP built-ins in addition to the user’s PSR-4 / classmap.
StubVfs
A read-only map from stub file path to its embedded PHP source content.
TemplateParam
Type

Enums§

IssueKind
LoadOutcome
Outcome of a AnalysisSession::load_class attempt.
Name
A semantic identifier for a code entity that the analyzer can resolve.
ScopeId
Identifies a single analysis scope within a project.
Severity
SymbolLookupError
Reason a symbol lookup did not return a location.
Visibility

Traits§

ClassResolver
Pluggable strategy for mapping a fully-qualified class name to the file that should define it. The analyzer never touches vendor/ or the filesystem on its own — it asks a ClassResolver when a symbol is needed.

Functions§

is_builtin_function
Returns true if name is a known PHP built-in function.
location_from_span
Convert a parser php_ast::Span (byte-offset range) into a mir_types::Location (file path + 1-based line range + 0-based codepoint columns) using source and the parser’s source_map.
stub_files
Every PHP stub file from stubs/{ext}/ embedded at compile time as (path, content).
stub_path_for_class
Look up the stub virtual path that defines a built-in PHP class / interface / trait / enum. Lookup is case-insensitive. Strips a single leading backslash if present. Returns None if not a known built-in type.
type_from_hint
Convert a PHP AST type hint to a mir Type type. context_fqcn is the class where this type hint appears (used for self/parent).