Donald Thomas has all his ducks in a row.

Literally.

Scores of rubber ducks of every shape, size, and variety are neatly aligned on the shelves of his locker.

“Somebody — I have an idea who, but I’m not sure — has been putting a duck in my locker almost every day since I’ve been here,” he said.

And why is that?

“Maybe because my name is Donald,” he replied.

Donald Duck is more famous than Donald Thomas will ever be.

Thomas has been with the New England Patriots since mid-September, when they signed him two days after beating the Dolphins in Miami in the season opener.

Although even the most ardent Pats fan would likely be hard-pressed to identify him, the Patriots might not have been able to defeat the Dolphins a second time if Thomas — along with rookie tackles Nate Solder and Marcus Cannon — hadn’t been able to step in on short notice.

If Thomas didn’t, shall we say, have all his ducks in the proverbial row.

There is no question the AFC-leading Patriots ducked a disaster against the Dolphins this time, after upset-minded Dolphins opened up a 17-0 lead at halftime. New England’s defense was reeling like men who’d had too much eggnog, and the offensive line was more patchwork than Bob Cratchit’s jacket.

“We lost Matt (Light) an hour and a half before the game,” quarterback Tom Brady said. “We lost Logan (Mankins) on the second series of the game.”

Left tackle Light is Brady’s prime protector. Bothered by a sore ankle, he tested it in pregame warm ups but was unable to go.

That prompted coach Bill Belichick to shift Mankins, his all-pro left guard, to left tackle — a move that lasted just two series, until Mankins injured his left knee and was done for the day.

Which left the Patriots with Thomas — who’s bounced from Miami, to Detroit, to New England over the past two years — at left guard, and the two first-year guys playing tackle.

Thomas hadn’t started a game since 2009, when he played for the Dolphins. Who decided, at the end of training camp last year, to cut him.

“They gave me a million reasons why,” he said. “But, basically, they said: ‘You’re not good enough to play for us.’ “

The Patriots thought Solder was good enough to draft in the first round, 17th overall. At the time, there was talk he might take over for Light right away. So it would have been disappointing had he not been able to fill in capably by now.

As for Cannon, it’s wonderful that he’s even playing football, considering that, earlier this year, he underwent treatment for non-Hodgkins lymphoma — cancer.

He was diagnosed in April. The disease is treatable, and so the Patriots drafted him in the fifth round, despite knowing he wouldn’t be able to play right away.

“This was Marcus’ first time rolling in a game, not just playing in certain packages,” Thomas said. “I thought he did a great job.”

The Patriots had their work cut out for them following a dreadful first half that left them scoreless and trailing by 17.

“There was no one going crazy (at halftime),” Thomas said of the New England locker room at halftime. “We know what type of offense we have. We know what we’re capable of doing.”

The game very well could have gone the wrong way for the Patriots, who were playing to retain the top seed in the AFC, while the Dolphins, who fired head coach Tony Sparano two weeks ago, were playing only for pride.

The New England defense, which gave up some big plays and long drives in the first half, came up with some turnovers in the second, which Brady and the makeshift offense turned into points.

“You certainly don’t want to make a habit of this,” Brady said. “But we did it. … We showed some resiliency, some mental toughness, and we pulled out a tough game. Hopefully, we get some guys back next week.”

Hopefully, they will.

But, if they don’t, Thomas and the rest of the backups on the roster have the starters’ backs because, as a look in his locker shows, they have all their ducks in a row.