[CLEANUP] Add PHPDoc comments and type hinting.