Merge pull request #4244 from tivnet/master

PhpDocs and TODO comments
Code styling fixes and return values for #4244
More code styling and return value optimisations