hasPhaseCondition function
Whether conditions (also inside a ConditionGroup) include a
ConfigurationCondition of phase; the context uses it to tell which
definitions must wait for the registerBean phase.
Implementation
bool hasPhaseCondition(
Iterable<Condition> conditions,
ConfigurationPhase phase,
) => conditions.any(
(condition) => switch (condition) {
ConfigurationCondition(:final configurationPhase) =>
configurationPhase == phase,
ConditionGroup(:final conditions) => hasPhaseCondition(conditions, phase),
_ => false,
},
);