PIM-1113: Add php doc and clean code