A 36-goal scorer is moving closer to home and couldn’t be happier about it.

No, the other one.

James van Riemsdyk signed a $35 million, five-year contract with the Philadelphia Flyers on Sunday, the second-richest deal signed by an NHL unrestricted free agent when the market opened and John Tavares left the Islanders for his hometown team in Toronto.

It’s the kind of long-term, big-money contract general manager Ron Hextall has been unwilling to hand out to free agents, though van Riemsdyk became an exception.

"The term we could live with," Hextall said. "We can manage our way around the salary cap. We’ve looked up, down and all around at different projections for the next few years and we felt comfortable with the term and the player."

Van Riemsdyk will count $7 million against the salary cap through 2022-23, which is currently third on the Flyers behind captain Claude Giroux at $8.275 million and winger Jakub Voracek at $8.25 million. Taken by Philadelphia second overall behind Patrick Kane in the 2007 draft, van Riemsdyk played with Giroux and Voracek during his first stint and talked to them before picking the Flyers over other interested teams.

The 29-year-old wasn’t likely to return to Toronto even before the Maple Leafs won the Tavares sweepstakes. But the Middletown, New Jersey, native also grew up rooting for the New York Rangers and picked the Flyers in large part because of familiarity .

"There were a couple different teams in the mix," van Riemsdyk said. "I’m happy to be coming to Philadelphia, and I think it’s going to be a great fit."

Van Riemsdyk set a career high with 36 goals last season, a year after putting up a career-high 62 points. The 6-foot-3, 217-pound winger who was traded to the Maple Leafs in 2012 isn’t a fundamentally different player now but gained confidence and experience from a bigger role in Toronto the past six seasons.

"I think my whole game has definitely expanded," van Riemsdyk said. "Style-wise, I think I’m still very similar. I think I’m still a cerebral type of player who can skate well and have good offensive instincts and can make the smart plays in all three zones."

He has to be for the Flyers to make this type of commitment. This is by far Hextall’s biggest free agent signing and Philadelphia’s richest since giving goaltender Ilya Bryzgalov $41.88 million on a nine-year deal in 2011.

Bryzgalov is retired and still collecting $1.6 million a year from the Flyers through 2026-27. As Bryzgalov was tweeting from Russia’s World Cup game against Spain, the Flyers were introducing van Riemsdyk, who they hope will be a far better use of money with an eye toward contending for the Stanley Cup in the coming years.

"Our philosophy four years ago was to get our cap in order and gather young assets," Hextall said. "We’ve kind of been through that process now. It’s coming to fruition in terms of guys we have on our team and where we can add to strengthen our team, we want to do it."