my courts are different than the other poster. The magistrate asks the landlord how much rent is owed. they ask the tenant if that's correct. I've never had anyone say they paid and I was wrong. End of case. In PA, they don't have a 'repairs" defense.
there is a 'repair" defense but if it's used, the tenant had to have paid the rent into the court at the time it was due and sent some type notice to the landlord - not sure because I've never seen anyone do this.