code style fix, added missing type hints and updated php docs