The Messenger of Allah ﷺ said, "Straighten your rows, for straightening the rows is part of establishing the prayer."
قال رسول الله ﷺ: سروا صفوفكم، فإن تسوية الصفوف من إقامة الصلاة.
Bukhari related it in the Book of Adhan (723), and Muslim in the Book of Prayer (433), both from the hadith of Shuba, who said, I heard Qatada narrating from Anas bin Malik, and he mentioned it. The wording given is that of Bukhari.As for Muslim's wording, "for straightening the row is part of the completeness of the prayer," what appears to be the case is that the narrators transmitted the hadith according to its meaning, and understood from the hadith that "the establishment of the prayer" and "the completeness of the prayer" carry one and the same meaning.