Apply a substitution map to a list of generic annotations. Each entry is `(ClassName, [TypeArg1, TypeArg2, …])`. Only the type arguments are substituted; the class name is left unchanged.
(
generics: &mut [(Atom, Vec<PhpType>)],
subs: &HashMap<String, PhpType>,
)
| 1448 | /// Each entry is `(ClassName, [TypeArg1, TypeArg2, …])`. Only the type |
| 1449 | /// arguments are substituted; the class name is left unchanged. |
| 1450 | fn apply_substitution_to_generics( |
| 1451 | generics: &mut [(Atom, Vec<PhpType>)], |
| 1452 | subs: &HashMap<String, PhpType>, |
| 1453 | ) { |
| 1454 | for (_class_name, type_args) in generics.iter_mut() { |
| 1455 | for arg in type_args.iter_mut() { |
| 1456 | let substituted = arg.substitute(subs); |
| 1457 | if substituted != *arg { |
| 1458 | *arg = substituted; |
| 1459 | } |
| 1460 | } |
| 1461 | } |
| 1462 | } |
| 1463 | |
| 1464 | // ─── Tests ────────────────────────────────────────────────────────────────── |
| 1465 |
no test coverage detected