Follow-up to #16396: cleanup code, added phpDoc and XCLASS definition