Fix PHPDoc and deprecated code

Some PHPDocs were incorrect, also used this opportunity to replace some deprecated functions.