Two years is not very long.
Temperatures in a residential garage are not necessarily that high (or that cold). With all respect to
@Boyd01's anecdotal evidence (and recognizing that attic temperatures are likely to be more extreme than garage temperatures), here are some actual specs - iPhone 13 Pro operating ambient is 32° to 95° F (0° to 35° C), and non operating temperature (which is what applies here) is −4° to 113° F (−20° to 45° C), with relative humidity 5% to 95%.
Connect it to a charger and then try! I'm betting that it works just fine.