Differential Dynamic Programming for Multi-Phase Rigid Contact Dynamics