By Sam Bush

We all knew that it was just a matter of time before Bryce Harper got his act together at the plate.

And yesterday was that time.

The $330 million slugger homered for the second straight day and pinch-hitter J.T. Realmuto also went deep to help the Phillies sweep the Colorado Rockies with a 7-5 victory.

Harper’s tiebreaking, two-run shot in the sixth inning wasn’t as prodigious as his 466-foot drive in Saturday’s 2-1 victory, but this 404-footer had plenty of distance to clear the right-center wall for the NL East leaders.

The 2015 NL MVP also had a first-inning single and an RBI groundout in the second. He is batting .417 with two homers and six RBI in his last three games after hitting .148 without an RBI while striking out 13 times during an eight-game stretch.

“We all knew this moment was coming,” Phillies manager Gabe Kapler said. “When he’s on, he’s so captivating and charismatic.”

Kapler resisted a daily growing buzz to sit Harper during his recent slump, instead letting him play through it. While the results have changed, Harper’s approach hasn’t.

“Each day I try to get better and stick with the same routine,” Harper said. “Keep progressing whether you’re 0 for 4 or 4 for 4. Same mindset.”

Realmuto tied it at 5 in the sixth with his first career pinch-hit homer, a two-run shot to left off Bryan Shaw (2-1). Rockies manager Bud Black lifted Shaw for Mike Dunn with one on and two outs to face Harper, who launched a 3-1 slider into Philadelphia’s bullpen.

“Got a pitch over the plate I could handle,” Harper said.

That set off a wild celebration from the crowd of 38,603 — many of them kids wearing an arm sleeve giveaway similar to Harper’s.

Earlier in the week, Harper was hearing boos.

Now cheers.

No offense taken.

“Plain and simple, they (care),” Harper said. “The city has my back.”

Edgar Garcia (1-0) got one out in the sixth for his first major league win. Pat Neshek pitched a scoreless ninth for his third save.