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

Function enrich_constructor_parameters_by_name

src/inheritance.rs:237–249  ·  view source on GitHub ↗

Enrich constructor parameters from ancestor parameters, matched by name. Unlike regular methods (which follow Liskov substitution and can safely use positional matching), constructors can have completely different signatures. Only parameters with the **same name** in both the child and ancestor are enriched.

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

Source from the content-addressed store, hash-verified

235/// different signatures. Only parameters with the **same name** in
236/// both the child and ancestor are enriched.
237fn enrich_constructor_parameters_by_name(
238 existing_params: &mut [ParameterInfo],
239 ancestor_params: &[ParameterInfo],
240) {
241 for existing_param in existing_params.iter_mut() {
242 if let Some(ancestor_param) = ancestor_params
243 .iter()
244 .find(|ap| ap.name == existing_param.name)
245 {
246 enrich_single_parameter(existing_param, ancestor_param);
247 }
248 }
249}
250
251/// Enrich a single child parameter from an ancestor parameter.
252///

Callers 1

Calls 3

enrich_single_parameterFunction · 0.85
iterMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected