the phone. A bad cable can even heat up the charging port itself. Make sure to use only original or certified chargers and cables that meet your phone’s listed ratings.
If your cable or charger have been damaged, do not keep using them. Find the correct charger and cable and replace them.