Fix PHPDoc and deprecated code

Some PHPDocs were incorrect, also used this opportunity to replace some deprecated functions.
Merge pull request #12402 from owncloud/fix-phpdoc

Fix PHPDoc and deprecated code