XClass implementation of https://review.typo3.org/#/c/30870/