phpdoc fixes

PhpDoc fixes, mainly to get autocompletion working and get rid of warnings/errors in IDE.

Feel free to correct me if I broke the coding guide style at some point, I can fix it.