SAN JOSE — Washington Capitals General Manager Brian MacLellan has spent more time talking about injuries, the roster and the salary cap this season than ever before.

From two players spending time on long-term injured reserve to having multiple shorter-term injuries to shuffling players to and from the team’s American Hockey League affiliate in ­Hershey, Pa., Washington’s front office has kept busy — and all of it has been complicated by the salary cap.

“I think we’re day-to-day ­making decisions,” MacLellan told reporters last week. “It’s tough. We can play that game of projecting . . . are we going to have a guy on LTI or not on LTI? There’s so many factors that go into the day-to-day decisions.”

That continued Monday when the Capitals traded Chandler Stephenson to the Vegas Golden Knights for a 2021 fifth-round draft pick. Washington needed to clear space to take forward Carl Hagelin off long-term injured reserve ahead of Tuesday’s game at San Jose. Hagelin, who has a $2.75 million salary cap hit, had missed the past 11 games.

Washington also sent forward Beck Malenstyn and defenseman Christian Djoos to Hershey cap-related moves in anticipation of the returns of Hagelin and Nicklas Backstrom.

But even after all those moves, the Capitals remain in a salary cap bind. They have only one extra forward on the roster: Travis Boyd. Per, Washington has just enough space to recall a seventh defenseman if needed. However, while on this three-game West Coast trip, the Capitals are carrying just six.

Washington’s roster has been an ever-changing jigsaw puzzle in which the final pieces often are determined purely by salary.

“Half the teams in the league — more than half the teams in the league — are in the same spot we’re in, where you’re right at the cap, you’re $1 million away from the cap,” MacLellan said. “When you get injuries, it forces you to make certain decisions that you might not normally make.”

Some decisions don’t allow much time to strategize, such as when the team played 11 forwards and seven defensemen in a 5-2 loss to Montreal after Nic Dowd and Hagelin were ruled out that same morning. The team had only enough cap space to call up a defenseman — Tyler Lewington, the cheapest player in the organization, with a $675,000 cap hit. Every forward carries at least a $700,000 cap hit.

Lewington’s call-up couldn’t even happen the night before the game, because the Capitals accumulated enough cap room only that morning. There have been times this season, the Capitals said, that they would not have had enough cap room to call up a replacement if anyone else had gotten hurt.

The day after Lewington was called up, he was sent back down, along with backup goaltender Ilya Samsonov, so the team could get the standard 12 forwards and six defensemen on the roster. In the exchange, the Capitals recalled Boyd and goaltender Vitek Vanecek.

But as any coach will argue, roster moves can’t be decided solely by salary. Before the season, Coach Todd Reirden said he wanted to stress to his players that the best lineup would play each night. Yes, the salary cap was a complication, but the team knew how to get creative.

“That’s part of the decision,” Reirden said of the tight salary cap. “And ultimately what ends up happening is you end up putting the best players on the ice, and it’s up to me to find a way to make it work.”

These factors culminated in Monday night’s trade. Having to choose between Stephenson and Boyd as the extra forward on the roster, the Capitals decided Boyd had outplayed Stephenson since his recall from Hershey. Boyd was cheaper and producing more. Not wanting to lose either player for nothing on the waiver wire, they found a way to get a draft pick in return.

With the additions of forwards Brendan Leipsic and Garnet Hathaway in the offseason to join Hagelin and Dowd, the Capitals felt they had enough depth and penalty killers to trade Stephenson — and Boyd can be used on the power play.

“[Boyd is] better than he was last year, in my mind,” MacLellan said last week. “Offensive zone, he’s controlled the play a little bit better. I think he’s always been pretty good in the offensive zone, but he’s winning more battles, he’s creating off the cycle. I think he’s done a great job for us this year.”

Read more on the Capitals: