The Flyers’ badly kept secret is out: They officially signed center Kevin Hayes to a seven-year, $50 million contract.

General manager Chuck Fletcher confirmed the deal Wednesday. It carries a $7.14 million annual cap hit, making Hayes the team’s third-highest-paid player, behind Claude Giroux ($8.28 million) and Jake Voracek ($8.25 million).

“He plays a smart two-way game and is just entering the prime of his career,” Fletcher said. “Kevin will add size and speed to our lineup. ... We like his 200-foot game. We think he really rounds out our forward group and will give our coaching staff lots of options going forward."

The 6-foot-5, 216-pound Hayes is expected to be the Flyers’ second-line center, pushing Nolan Patrick (13 goals, 31 points last season) down to the third unit.

Hayes said that it was a “no-brainer” to sign with the Flyers and that having his former New York Rangers coach, Alain Vigneault, direct the team made his decision easier.

“Playing under AV for four years, I mean, we had a great relationship on and off the ice,” said Hayes, who had a career-high 25 goals for Vigneault’s Rangers in 2017-18. “He demands hard work, and if you play correctly he kind of lets you play freely offensively. That was a huge factor in the decision.”

The Massachusetts native said the Flyers were at the top of the list for how he fit on the team.

“Ultimately, me and my agent wanted to go to a great city, a team that can win and a team that can kind of go for the Stanley Cup,” Hayes said. “And the Flyers are one of those teams, we think.”

Hayes, 27, had a combined 19 goals and a career-high 55 points in 71 games last season for the Rangers and Winnipeg Jets. The Flyers acquired his rights earlier this month by sending a fifth-round draft pick to Winnipeg, hoping to sign Hayes before he became an unrestricted free agent July 1.

Fletcher confirmed Hayes has a no-movement clause in the first three years of the deal, which protects him from (among other things) being exposed to Seattle in the 2021 expansion draft. After the first three years, he has a no-trade list that includes 12 teams.

It’s been a whirlwind week for Fletcher. He signed Hayes, acquired veteran defensemen Matt Niskanen and Justin Braun, and bought out defenseman Andrew MacDonald.

“We’re stronger, we’re deeper, and we filled a lot of the holes we identified coming into the summer,” said Fletcher, whose team was 29th in the NHL in goals-allowed (3.41 per game) and 18th in goals scored (2.94 per game) last season.

Hayes, a former Boston College star, is expected to be used on the power play and penalty kill.

“If that’s going to help the team win, obviously I’d love to do it,” he said. “Whatever they need me to do.”

The Flyers have $60.1 million earmarked for just 16 players, and the cap is expected to be at around $82 million. They still want to sign five restricted free agents — Ivan Provorov, Travis Sanheim, Travis Konecny, Scott Laughton, and Ryan Hartman — along with a backup goalie.

By adding Hayes, Niskanen ($5.75 million), and Braun ($3.8 million) and retaining $1.01 million toward Radko Gudas’ traded contract, the Flyers, provided they don’t make any more trades, won’t have much money to spend in the free-agent market when you factor in the restricted free agents they are expected to sign.

Acquiring Niskanen and Braun “shows they’re in a win-now mentality,” Hayes said. “Those guys are established players. Niskanen has a Cup. They’re only going to help the team.”

“We’re a deeper group, but we have a lot of work to do in training camp,” Fletcher said about how the new coaching staff must implement its systems with a new-look team.

As for making more trades or signing free agents, Fletcher said he would continue to explore deals. But his focus for the next couple of days is on the draft, which will be held Friday and Saturday in Vancouver, and talking to agents who represent the five key restricted free agents.

“We have some work ahead of us with the RFAs,” said Fletcher, who hinted that Laughton could be a contender for a third-line winger spot, “... but I think we’re in a good position in what we have to deal with.”

Fletcher said that including a second-round pick (41st overall) in the Braun trade was not difficult because the Flyers still have their first-round selection (11th overall) and two relatively early picks in the third round.

“And probably as importantly as anything, we’ve kept all our prospects," Fletcher said, "and our staff has worked hard the last few years to acquire some top picks and some top kids and we’ve been able to keep all those assets. We’re still as deep as any franchise with respect to quantity and quality of prospects.”