fixed some typo and added some php docs