Fix some code formatting issues and complete the phpDoc comments