[ticket/12039] Use an abstract class and some more minor adjustments

PHPBB3-12039