General fixes, style and comments / phpdoc

Add phpdoc to benefit editors
Remove used of a deprected method
Stop assigning in conditions

Change-Id: I24dceed8944d79eaeebf619ac8e449e7d02ece14