Skip to main content

Php

Struct Php 

Source
pub struct Php;
Expand description

PHP language support.

Trait Implementations§

Source§

impl Language for Php

Source§

fn name(&self) -> &'static str

Display name for this language (e.g., “Python”, “C++”)
Source§

fn extensions(&self) -> &'static [&'static str]

File extensions this language handles (e.g., [“py”, “pyi”, “pyw”])
Source§

fn grammar_name(&self) -> &'static str

Grammar name for arborium (e.g., “python”, “rust”)
Source§

fn has_symbols(&self) -> bool

Whether this language has code symbols (functions, classes, etc.)
Source§

fn container_kinds(&self) -> &'static [&'static str]

Container nodes that can hold methods (class, impl, module)
Source§

fn function_kinds(&self) -> &'static [&'static str]

Function/method definition nodes
Source§

fn type_kinds(&self) -> &'static [&'static str]

Type definition nodes (struct, enum, interface, type alias)
Source§

fn import_kinds(&self) -> &'static [&'static str]

Import statement nodes
Source§

fn public_symbol_kinds(&self) -> &'static [&'static str]

AST node kinds that may contain publicly visible symbols. For JS/TS: export_statement nodes. For Go/Java/Python: function/class/type declaration nodes. The extract_public_symbols() method filters by actual visibility.
Source§

fn visibility_mechanism(&self) -> VisibilityMechanism

How this language determines symbol visibility
Source§

fn extract_public_symbols(&self, node: &Node<'_>, content: &str) -> Vec<Export>

Extract public symbols from a node. The node is one of the kinds from public_symbol_kinds(). For JS/TS: extracts exported names from export statements. For Go/Java/Python: checks visibility and returns public symbols.
Source§

fn scope_creating_kinds(&self) -> &'static [&'static str]

Nodes that create new variable scopes (for scope analysis) Includes: loops, blocks, comprehensions, lambdas, with statements Note: Functions and containers (from function_kinds/container_kinds) also create scopes
Source§

fn control_flow_kinds(&self) -> &'static [&'static str]

Nodes that affect control flow (for CFG analysis) Includes: if, for, while, return, break, continue, try, match
Source§

fn complexity_nodes(&self) -> &'static [&'static str]

Nodes that increase cyclomatic complexity
Source§

fn nesting_nodes(&self) -> &'static [&'static str]

Nodes that indicate nesting depth
Source§

fn signature_suffix(&self) -> &'static str

Suffix to append to signatures for tree-sitter parsing. Function signatures are incomplete code fragments that need closing tokens to parse correctly (e.g., Rust fn foo() needs {}, Lua function foo() needs end). Returns the suffix to append, or empty string if none needed.
Source§

fn extract_function( &self, node: &Node<'_>, content: &str, _in_container: bool, ) -> Option<Symbol>

Extract symbol from a function/method node
Source§

fn extract_container(&self, node: &Node<'_>, content: &str) -> Option<Symbol>

Extract symbol from a container node (class, impl, module)
Source§

fn extract_type(&self, node: &Node<'_>, content: &str) -> Option<Symbol>

Extract symbol from a type definition node
Source§

fn extract_docstring(&self, node: &Node<'_>, content: &str) -> Option<String>

Extract docstring/doc comment for a node
Source§

fn extract_attributes(&self, _node: &Node<'_>, _content: &str) -> Vec<String>

Extract attributes/decorators for a node (e.g., #test, @Test)
Source§

fn extract_imports(&self, node: &Node<'_>, content: &str) -> Vec<Import>

Extract imports from an import node (may return multiple)
Source§

fn format_import(&self, import: &Import, _names: Option<&[&str]>) -> String

Format an import as source code. If names is Some, only include those names (for multi-import filtering). If names is None, format the complete import.
Source§

fn is_public(&self, node: &Node<'_>, content: &str) -> bool

Check if a node is public/exported
Source§

fn is_test_symbol(&self, symbol: &Symbol) -> bool

Check if a symbol is a test (for filtering). Each language must implement this - test conventions are language-specific.
Source§

fn embedded_content( &self, _node: &Node<'_>, _content: &str, ) -> Option<EmbeddedBlock>

Extract embedded content from a node (e.g., JS/CSS in Vue/HTML). Returns None for nodes that don’t contain embedded code in another language.
Source§

fn container_body<'a>(&self, node: &'a Node<'a>) -> Option<Node<'a>>

Find the body node of a container (for prepend/append)
Source§

fn body_has_docstring(&self, _body: &Node<'_>, _content: &str) -> bool

Detect if first child of body is a docstring
Source§

fn node_name<'a>(&self, node: &Node<'_>, content: &'a str) -> Option<&'a str>

Get the name of a node (typically via “name” field)
Source§

fn file_path_to_module_name(&self, path: &Path) -> Option<String>

Convert a file path to a module name for this language. Used to find “importers” - files that import a given file. Returns None for languages without module systems or where not applicable.
Source§

fn module_name_to_paths(&self, module: &str) -> Vec<String>

Convert a module name to candidate file paths (inverse of file_path_to_module_name). Returns relative paths that could contain the module. Used for wildcard import resolution (e.g., from foo import *).
Source§

fn is_stdlib_import(&self, _import_name: &str, _project_root: &Path) -> bool

Check if an import is from the standard library.
Source§

fn find_stdlib(&self, _project_root: &Path) -> Option<PathBuf>

Find standard library directory (if applicable). Returns None for languages without a separate stdlib to index.
Source§

fn get_visibility(&self, node: &Node<'_>, content: &str) -> Visibility

Get visibility of a node
Source§

fn lang_key(&self) -> &'static str

Language key for package index cache (e.g., “python”, “go”, “js”).
Source§

fn resolve_local_import( &self, import: &str, _current_file: &Path, project_root: &Path, ) -> Option<PathBuf>

Resolve a local import within the project. Read more
Source§

fn resolve_external_import( &self, _import_name: &str, _project_root: &Path, ) -> Option<ResolvedPackage>

Resolve an external import to its source location. Read more
Source§

fn get_version(&self, project_root: &Path) -> Option<String>

Get the language/runtime version (for package index versioning).
Source§

fn find_package_cache(&self, project_root: &Path) -> Option<PathBuf>

Find package cache/installation directory.
Source§

fn indexable_extensions(&self) -> &'static [&'static str]

File extensions to index when caching a package.
Source§

fn package_sources(&self, _project_root: &Path) -> Vec<PackageSource>

Return package sources to index for this language. Each source describes a directory containing packages.
Source§

fn should_skip_package_entry(&self, name: &str, is_dir: bool) -> bool

Should this entry be skipped when indexing packages? Called for each file/directory in package directories. Use helper functions skip_dotfiles() and has_extension(name, self.indexable_extensions()) for common checks.
Source§

fn discover_packages(&self, _source: &PackageSource) -> Vec<(String, PathBuf)>

Discover packages in a source directory. Returns (package_name, path) pairs for all packages found. Use provided helpers: discover_flat_packages, discover_recursive_packages, discover_npm_scoped_packages.
Source§

fn package_module_name(&self, entry_name: &str) -> String

Get the module/package name from a directory entry name.
Source§

fn find_package_entry(&self, path: &Path) -> Option<PathBuf>

Find the entry point file for a package path. If path is a file, returns it directly. If path is a directory, looks for language-specific entry points.
Source§

fn discover_flat_packages(&self, source_path: &Path) -> Vec<(String, PathBuf)>

Discover packages in a flat directory (each entry is a package).
Source§

fn discover_recursive_packages( &self, base_path: &Path, current_path: &Path, ) -> Vec<(String, PathBuf)>

Discover packages recursively (each file with matching extension is a package).
Source§

fn discover_npm_scoped_packages( &self, source_path: &Path, ) -> Vec<(String, PathBuf)>

Discover packages in npm-scoped directory (handles @scope/package).

Auto Trait Implementations§

§

impl Freeze for Php

§

impl RefUnwindSafe for Php

§

impl Send for Php

§

impl Sync for Php

§

impl Unpin for Php

§

impl UnwindSafe for Php

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more