remove unused code and fix wrong variable names - some PHPDoc updated

fixes #7443