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

Function enrich_parameters_from_ancestor

src/inheritance.rs:222–229  ·  view source on GitHub ↗

Enrich child parameters from ancestor parameters, matched by position. When a child parameter's `type_hint` equals its `native_type_hint` (no docblock override) and the ancestor parameter has a richer type, copy the ancestor's `type_hint`. Also inherit `description` when the child parameter has none.

(
    existing_params: &mut [ParameterInfo],
    ancestor_params: &[ParameterInfo],
)

Source from the content-addressed store, hash-verified

220/// copy the ancestor's `type_hint`. Also inherit `description` when
221/// the child parameter has none.
222fn enrich_parameters_from_ancestor(
223 existing_params: &mut [ParameterInfo],
224 ancestor_params: &[ParameterInfo],
225) {
226 for (existing_param, ancestor_param) in existing_params.iter_mut().zip(ancestor_params) {
227 enrich_single_parameter(existing_param, ancestor_param);
228 }
229}
230
231/// Enrich constructor parameters from ancestor parameters, matched by name.
232///

Callers 1

Calls 1

enrich_single_parameterFunction · 0.85

Tested by

no test coverage detected