Shawn Porter defeated Danny Garcia in a battle of former welterweight champions to claim the vacant WBC title.