Israel formally declared war on Sunday and gave the green light for “significant military steps” to retaliate against Hamas for its surprise attack.