SAN FRANCISCO -- When Alcides Torreyes wasn’t working construction in a small town in northern Venezuela, he played third base or center field for an amateur baseball team. His son usually tagged along, and as the boy got older, he started training with his father and learning the game.

That was how the unlikely legend of Ronald Torreyes began.

“My dad was very instrumental to me,” Torreyes, the Phillies’ hide-saving utility infielder, said Sunday through a team translator. “He was always a mentor. He got me ready to have this opportunity because he wasn’t able to have it due to some family circumstances. But he wanted me to achieve the dream that he had for himself.”

Where would the Phillies be without Torreyes? Possibly not within 3 1/2 games of the division-leading New York Mets entering Sunday’s series finale here against the San Francisco Giants.

For five weeks, Torreyes has filled in at shortstop, starting 20 of 24 games in place of injured Didi Gregorius. He was 21-for-74 (.284) with a .758 OPS in 78 plate appearances and even popped two home runs, including a go-ahead solo shot in Saturday’s 13-6 victory.

“People say, ‘Why do you love Torreyes?’ He’s a ballplayer,” manager Joe Girardi said. “That’s what he is. He really understands the game. And I trust him wherever I put him. I don’t ever worry about him. I can put him at third, short, second, first, left, center, right, and I know he’s prepared. That’s a luxury for a manager. I don’t know where we’d be without him.”

» READ MORE: Phillies select contract of outfielder Matt Vierling, place Matt Joyce on injured list

Torreyes said he owes it all to his dad, not only because Alcides hit him thousands of grounders. Torreyes was one of the shortest kids on youth teams that were often coached by his father. Even now, he’s listed at 5-foot-8 but says he’s “probably 5-6 or 5-5.”

It would have been easy to dismiss Torreyes as too small. But Alcides made sure that his son believed he could play.

“He never allowed that to be an obstacle for me,” Torreyes said. “He said, ‘You’ve got to show them that it doesn’t matter how tall you are or how short you are. You’re ready to play. You can perform at the highest level that you go to.’”

Torreyes must have taken it to heart. What other explanation is there for the major league career that he has carved out?

Signed by the Reds as a 17-year-old in 2010, he was traded to the Cubs in 2011 before bouncing to the Astros, Blue Jays, and Dodgers. He made his major league debut for Los Angeles late in the 2015 season before getting traded to the Yankees, claimed off waivers by the Angels, and reclaimed by the Yankees.

That was when Girardi fell for him. The last thing a manager wants to worry about is the last player on his bench. In Torreyes, Girardi found someone who was always prepared to step in. And when Gregorius suffered a shoulder injury in 2017, Torreyes batted .308 in a monthlong run as the Yankees’ shortstop.

Four years later, Torreyes, Girardi, and Gregorius are reunited with the Phillies, and history has repeated.

From spring training on, I get ready as if I were an everyday player,” Torreyes said. “Because I understand my role on this team. Sometimes I’m not going to play for a week or two weeks, but sometimes if someone gets hurt, I may be in the lineup every day for a whole month.”

Torreyes says he’s “eternally grateful” to Girardi “because he’s given me all the chances that I could ever ask for.” You might say Girardi is his second-biggest benefactor.

Alcides has never seen his son play in the majors. He doesn’t have a visa, and even if he did, “he’s afraid of flying,” Torreyes said. But father and son talk several times a week. The coaching never stops.

“He always texts or calls me, even if I don’t do anything in the game,” Torreyes said. “He’s like, ‘Hey, keep your head up. Stay positive.’ He’s always watching the games and sending me pictures or videos. He’s always paying attention to me.”

» READ MORE: Phillies' Jean Segura optimistic he can return ahead of schedule from groin injury

Extra bases

Second baseman Jean Segura (left groin strain) ran in the outfield before the game. Segura, who was injured Tuesday night, is optimistic that he will miss less time than the Phillies’ initial three-week projection. ... One day after picking up his first major league hit and stolen base and scoring his first run, center fielder Matt Vierling made his first career start. ... The Phillies are off today. Zack Wheeler (5-3, 2.15 ERA) will start Tuesday night in the opener of a two-game series against the Washington Nationals at Citizens Bank Park.