add type hinting to validateErrors() method