for (int i = 0; i < phaseListeners.length; i++) {
PhaseListener phaseListener = phaseListeners[i];
int listenerPhaseId = phaseListener.getPhaseId().getOrdinal();
if (listenerPhaseId == PhaseId.ANY_PHASE.getOrdinal()
|| listenerPhaseId == phaseId.getOrdinal()) {
phaseListener.afterPhase(new PhaseEvent(FacesContext
.getCurrentInstance(), phaseId, lifecycle));
}
}
}